Rituraj Raman
Rituraj Raman

Reputation: 48

sync cleanly to another perforce label

TL;DR: How do I sync an existing p4 workspace to a new label, so that all my previous changes are undone, and it is as good as a new sync?

Hi, I have a perforce workspace synced to a label L1.

  1. I added/deleted/edited a few files
  2. I moved a few files inside a folder (mv a.txt b.txt new_folder/)

I want to cleanly sync this workspace to label L2 now.

I already removed all shelved and pending changelists, then tried

p4 reconcile -w ... && p4 revert -w ... && p4 sync ...@L2

Looks like it almost works, except that the files I moved inside a new folder do not get synced (p4 sync -f works though). But I do not want to use p4 sync -f on the entire workspace, as it would resync the unchanged files as well.

I am sorry if this question has been answered before, I am pretty new to perforce, so maybe could not find the correct terms to search for.

Upvotes: 1

Views: 168

Answers (1)

Samwise
Samwise

Reputation: 71454

The ... path limits the scope of each operation to the current directory; if you ran those commands from a different directory than the one you moved the files to, that may be why they didn't get synced. I'd do:

p4 revert //...
p4 clean //...
p4 sync @L2

Upvotes: 2

Related Questions