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

Use depot path syntax over local path syntax for syncing #214

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
18 changes: 10 additions & 8 deletions src/main/java/org/jenkinsci/plugins/p4/client/ClientHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,9 @@ public void syncFiles(P4Ref buildChange, Populate populate) throws Exception {
// Sync changes/labels
if (buildChange instanceof P4ChangeRef || buildChange instanceof P4LabelRef) {
// build file revision spec
String path = iclient.getRoot() + "/...";
String revisions = path + "@" + buildChange;
String localPath = iclient.getRoot() + "/...";
String depotPath = where(localPath);
String revisions = depotPath + "@" + buildChange;

// Sync files
if (populate instanceof CheckOnlyImpl) {
Expand Down Expand Up @@ -460,22 +461,23 @@ private void syncFiles(String revisions, Populate populate) throws Exception {
public void tidyWorkspace(Populate populate) throws Exception {
// relies on workspace view for scope.
log("");
String path = iclient.getRoot() + "/...";
String localPath = iclient.getRoot() + "/...";
String depotPath = where(localPath);

if (populate instanceof AutoCleanImpl) {
tidyAutoCleanImpl(path, populate);
tidyAutoCleanImpl(depotPath, populate);
}

if (populate instanceof ForceCleanImpl) {
tidyForceSyncImpl(path, populate);
tidyForceSyncImpl(depotPath, populate);
}

if (populate instanceof GraphHybridImpl) {
tidyForceSyncImpl(path, populate);
tidyForceSyncImpl(depotPath, populate);
}

if (populate instanceof SyncOnlyImpl) {
tidySyncOnlyImpl(path, populate);
tidySyncOnlyImpl(depotPath, populate);
}
}

Expand All @@ -492,7 +494,7 @@ private void tidyForceSyncImpl(String path, Populate populate) throws Exception
tidyPending(path);

// remove all versioned files (clean have list)
String revisions = iclient.getRoot() + "/...#0";
String revisions = path + "#0";

// Only use quiet populate option to insure a clean sync
boolean quiet = populate.isQuiet();
Expand Down