AlexUk
AlexUk

Reputation: 21

Get list of items changed/added/removed in Perforce . . . using BAT commands

I am working on a BAT file that gets the list of files that have been modified/added in my local repository and then copies them to a new folder (sort of a back-up BAT).

Is it possible to retrieve that list of files from somewhere? Can I use some commands in the BAT to call perforce commands that return that list? What would that command be?

Appreciate any help!

Upvotes: 2

Views: 287

Answers (3)

jamesdlin
jamesdlin

Reputation: 89926

You also can do:

p4 reconcile
p4 diff > backup.patch

And now you've backed up all changes in the client. Note that this won't work for binary files.

Upvotes: 0

Bryan Pendleton
Bryan Pendleton

Reputation: 16339

If you want to make a backup of the files you've modified or added, consider this approach:

p4 reconcile

p4 shelve

Reconcile will figure out which files you've modified or added; shelve will store them in the Perforce server (not as a submitted changelist, but as a shelved changelist).

Periodically, you can delete your old "backups" by doing:

p4 shelve -d
p4 change -d

to remove the files from the shelved changelist, and then to delete the changelist itself.

Upvotes: 1

tkosinski
tkosinski

Reputation: 1696

Say you have your files in C:\p4 -- you could do "p4 reconcile -n C:\p4..." to tell you what it would do if you needed to reconcile changes you made outside of Perforce's knowledge.

Or "p4 reconcile C:\p4..." to open any of the files for add, delete or edit and populate your pending changelist.

Upvotes: 0

Related Questions