Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getClientHead without range #200

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/main/java/org/jenkinsci/plugins/p4/client/ClientHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -1167,12 +1167,15 @@ public long getClientHead(P4Ref from, P4Ref to) throws Exception {
* @throws Exception push up stack
*/
public long getClientHead() throws Exception {
// try to find last change
long head = getClientHead(null, null);
if (head != 0L) {
return head;
}

// get last change in server, may return shelved CLs
String latestChange = getConnection().getCounter("change");
long latest = Long.parseLong(latestChange);
P4Ref to = new P4ChangeRef(latest);
long head = getClientHead(null, to);
return (head == 0L) ? latest : head;
return Long.parseLong(latestChange);
}

public List<IChangelistSummary> getPendingChangelists(boolean includeLongDescription, String clientName) throws Exception {
Expand Down