# Perforce Changelists

**URL:** https://www.finalbuilder.com/forums/t/perforce-changelists/125
**Category:** Discussion
**Created:** [July 10, 2006, 11:00am UTC](https://www.finalbuilder.com/forums/t/perforce-changelists/125 "2006-07-10T11:00:47Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![tmchardy](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/dbc845/32.png) [@tmchardy](https://www.finalbuilder.com/forums/u/tmchardy)
#### Post date: [July 10, 2006, 11:00am UTC](https://www.finalbuilder.com/forums/t/perforce-changelists/125/1 "2006-07-10T11:00:47Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![tate](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@tate](https://www.finalbuilder.com/forums/u/tate)
#### Post date: [July 11, 2006, 2:57am UTC](https://www.finalbuilder.com/forums/t/perforce-changelists/125/2 "2006-07-11T02:57:50Z")

</div>

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

---

<div class="post-metadata">

### Author: ![jswager](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/jswager/32/26_2.png) [@jswager](https://www.finalbuilder.com/forums/u/jswager)
#### Post date: [July 11, 2006, 6:30am UTC](https://www.finalbuilder.com/forums/t/perforce-changelists/125/3 "2006-07-11T06:30:39Z")

</div>

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](http://www.perforce.com/perforce/doc.061/manuals/cmdref/sync.html#1040665)  
  
for additional information.

---

<div class="post-metadata">

### Author: ![nirsilgi](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/n/a6a055/32.png) [@nirsilgi](https://www.finalbuilder.com/forums/u/nirsilgi)
#### Post date: [July 11, 2006, 7:05am UTC](https://www.finalbuilder.com/forums/t/perforce-changelists/125/4 "2006-07-11T07:05:05Z")

</div>

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

---

<div class="post-metadata">

### Author: ![tmchardy](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/dbc845/32.png) [@tmchardy](https://www.finalbuilder.com/forums/u/tmchardy)
#### Post date: [July 11, 2006, 7:46am UTC](https://www.finalbuilder.com/forums/t/perforce-changelists/125/5 "2006-07-11T07:46:54Z")

</div>

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. ;-)

---

<div class="post-metadata">

### Author: ![tmchardy](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/dbc845/32.png) [@tmchardy](https://www.finalbuilder.com/forums/u/tmchardy)
#### Post date: [July 12, 2006, 12:30pm UTC](https://www.finalbuilder.com/forums/t/perforce-changelists/125/6 "2006-07-12T12:30:37Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![nirsilgi](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/n/a6a055/32.png) [@nirsilgi](https://www.finalbuilder.com/forums/u/nirsilgi)
#### Post date: [July 12, 2006, 5:00am UTC](https://www.finalbuilder.com/forums/t/perforce-changelists/125/7 "2006-07-12T05:00:53Z")

</div>

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

---

<div class="post-metadata">

### Author: ![tmchardy](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/dbc845/32.png) [@tmchardy](https://www.finalbuilder.com/forums/u/tmchardy)
#### Post date: [July 12, 2006, 7:40am UTC](https://www.finalbuilder.com/forums/t/perforce-changelists/125/8 "2006-07-12T07:40:40Z")

</div>

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. :)

---

<div class="post-metadata">

### Author: ![tate](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@tate](https://www.finalbuilder.com/forums/u/tate)
#### Post date: [July 13, 2006, 3:46am UTC](https://www.finalbuilder.com/forums/t/perforce-changelists/125/9 "2006-07-13T03:46:18Z")

</div>

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
