开发者

Perforce (version control) - File change list since specific revision

开发者 https://www.devze.com 2023-04-06 12:51 出处:网络
I\'m extremely new to perforce and wasn\'t having very much luck searching online... but... Is there an way to get a list of all the files that have changed since a specific revision number? I开发者_

I'm extremely new to perforce and wasn't having very much luck searching online... but...

Is there an way to get a list of all the files that have changed since a specific revision number? I开发者_Python百科'm going to have to push something to our production server and instead of going through all of the files and checking, I'd like to tell Perforce to give me any files that have change since revision X.


While the p4 changes command is good, it shows all the changelists, not all the individual files that have changed. Google leads folks to this question when they are searching for how to list all files with Perforce, as that's what the question asked.

To list the files that have changed between your @start,@stop times,

p4 -c WORKSPACENAME files //Path/You/Care/About/...@2013/03/20:13:40,@2014/06/016:17:00


Personaly I think it makes a lot more sense (and I believe it is much faster) too work with changeslists instead. Something like:

p4 changes /myrepository...#changelist

Please note that revisions and changelists are not the same thing in perforce. In perforce you have revisions of a file for example revision 3 means the 3'rd change to THAT file. You also have changelists which map of the whole perforce depot. They represent a bunch of changed revisions mapped together when you commit. So for example you commit 3 files (file1: rev 3 file2: rev 5, and file3 also at rev3) and the changeset could be something like 5200 since you have committed 5199 times before this new commit.

Hope that helps.


You can start with p4 changes:

Use p4 changes to view a list of submitted and pending changelist

# Display all changelists submitted from April 1, 2001 to the present. 
p4 changes @2001/04/01,@now

From there, to display the files in each changelist, see p4 describe as detailed in "Is there a single Perforce command to display a list of all the check-ins to a file/dir along with the list of files that changed and the description?".


If you want all the files up to a particular change, then use the 'p4 files' command. For example:

  $ p4 files //...@7
  //depot/dev/fileA#2 - edit change 7 (text)
  //depot/dev/fileB#2 - edit change 7 (text)
  //depot/dev/fileC#2 - edit change 7 (text)
  //depot/main/fileA#1 - add change 1 (text)
  //depot/main/fileB#1 - add change 1 (text)
  //depot/main/fileC#1 - add change 1 (text)
  //depot/r1.0/fileA#1 - branch change 2 (text)
  //depot/r1.0/fileB#1 - branch change 2 (text)
  //depot/r1.0/fileC#1 - branch change 2 (text)

If you want files for only one particular changelist then use the @n,@n notation such as:

  $ p4 files //...@7,@7
  //depot/dev/fileA#2 - edit change 7 (text)
  //depot/dev/fileB#2 - edit change 7 (text)
  //depot/dev/fileC#2 - edit change 7 (text)

More details on 'p4 files' is found in the command reference:

http://www.perforce.com/perforce/doc.current/manuals/cmdref/p4_files.html

More details on file specifications here:

http://www.perforce.com/perforce/doc.current/manuals/cmdref/filespecs.html

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号