Perforce Changelists

FB 4.1.0.205

Well, this isn't a bug, so i guess it goes under the "feature request" category.

So I tried to use the P4 Sync feature with the "Changelists" option. When I did this, it started syncing everything, not just the changelist. So I went to the command line and tried to do it from there, and that's when I found out it doesn't work. I don't know how it's done through P4Win, but it *looks* like it reads through the changelist and syncs each individual file.

So, I now need this functionallity and don't know how to do it. I'm going to have to make some fancy read the changelist, parse it, etc, etc, thing instead of using the sync action.

Just thowing it out there.

Trevor.


have you tried asking the Perforce people how it should be done with p4.exe (if it’s possible at all…)?

I believe that this is expected Perforce behavior. Synching to a changelist will synch your workspace to the state of the depot at the point that the changelist was submitted.

See http://www.perforce.com/perforce/doc.061/manuals/cmdref/sync.html#1040665

for additional information.

That’s right, if you want to sync specific files you have to specify them along with the @CLnumber

I don't know how it's done through P4Win, but it *looks* like it reads through the changelist and syncs each individual file.


Yes, it definately is behaving correctly via a command line-like functionallity. But in P4Win, the default behaviour (You get a set of options) is to only sync the files in the changelist. This is different from the commandline where it syncs the workspace unless you specify a file. Which means, that they must be parsing the changelist in the P4Win application and syncing each file? (a guess on the behaviour).

This is desired by my script. Up until now, I have been putting a pause box in the script, logging into the machine doing the build, syncing the files manually through P4Win using changelists, then clicking the OK button to keep it running. I am now trying to make this step automated and hit this snag.

Hence: my feature request. ;-)

I am now doing this via the following steps:
- Command line using P4 Describe command to generate a temp file of the changelist
- Use a file itterator to scroll through the generated temp file
- Parse out each file found and use the P4 Sync command on that file only using the changelist number
- Delete the temp file created by this process.

I have run an initial test run of this and it seems to be working fine.

I think you are looking for the command:

p4 sync @=7236
Use it in the Perforce Generic command.

This will sync only the files in the CL.
I just found out about this command so test it, don’t take my word. And let me know if it works of course.
If it works the FB guys can add it as a feature


Yup, this is exactly what I was looking for via the command line, and would love to see this as an option in the sync feature. The Changelist sync in the FB Sync feature does the whole workspace right now. While I suppose this is good for some, i'll have to use a generic command for now:

My command:
p4 sync //branch/location/...@=[changelist]

Wish they'd document these thing better in the p4 help. :)

and would love to see this as an option in the sync feature.


Could you just add the following as the depot files in the sync command:
//branch/location/...@=[%mychangelistnumber%]

and then make sure you set mychangelistnumber using a set variable before the sync action runs.

.t8