[p4] Revision confusion

Dave Lewis dlewis78731 at gmail.com
Thu Aug 30 14:31:47 PDT 2007


On 8/30/07, Ivey, William <william_ivey at bmc.com> wrote:
> > It makes sense because that is what you synced to.
>
> It would make sense if sync completed, but it didn't. The
> first half fails, but the implicit p4 flush is unaffected
> by that. I assume it set the stage for a potential resolve,
> but I'd feel better if what it were doing were made more
> explicit. (Or if I had to explicitly issue a p4 flush to
> put it into that state.)

Well, the sync completes just the way it does when you edit an old
revision, then sync to head to schedule a resolve.

> > Some would think on revert it syncs to the latest
> > revision
>
> No, my assumption would have been that it reverted the file
> to the same revsion it was at when you opened it for edit.
> That's what it usually does. I tend to think of edit/revert
> as a do/undo pair, but that's not the case now that I know
> a command seemingly unrelated to editing can affect the
> outcome.

Well, since the old revision was synced to, then when you revert, it
gives you that old revision instead of the one you originally opened
for edit.  consider the outcome if it did not do this.  "p4 have"
would list the wrong file, and there would be no extenuating
circumstance to explain why it was wrong. (such as, its open for edit)
 By giving you what "p4 have" says is right, sync maintains its
consistency.

I thought of edit/revert as sort of do/undo too, but we can see the
situation is actually more subtle than that.  It *looks* that way if
you don't reset the "target" revisions with sync.

sync, in effect, sort of sets up the set of target revisions you want
to operate against.  In the case of editing an old revision, then
resolving up to the head revision, you can be much more specific in
the revisions you wish to skip by using sync to schedule the various
resolves necessary.  Like edit #1, sync to #2, accept yours, then sync
to head and resolve. This filters out #2 but keeps any other changes,
such as #3, #4.

In this case, its doing the same sorts of stuff, just in a direction
that people hardly ever go!

dave

>
> -Wm
>
>



More information about the perforce-user mailing list