Reputation: 141
Suppose I know a changelist that has some issues with the build. I want to know the previously submitted changelist so that I can sync to it.
I know a way to get it from p4v. I want to know how to get it via the p4 command so that I can add it to the bash script.
Ex. Changelist previous to 553682 is 553642
changelist number is managed by perforce across all the code base so i cannot reduce a number and take it.
Upvotes: 1
Views: 235
Reputation: 71424
Just subtract 1. If changelist @553682
is the broken one, syncing to @553681
will give you the revisions prior to those in that changelist.
This works even if change 553681 doesn't exist (i.e. the number got skipped), or if it's a changelist that affects a different part of the codebase. When you use a changelist as a revision specifier it defines the upper bound (in changelist terms) of all the revisions that will be affected by the operation; since changelists are strictly increasing, changelist numbers are always comparable in a straightforward way, similar to timestamps (i.e. you can sync to a particular point in time even if nothing was submitted at that precise nanosecond; you'll just get whatever was current as of that point in time).
tl;dr yes, just "reduce the number and take it," it'll work.
Upvotes: 1