[p4] diff between two revisions
Robert Cowham
robert at vaccaperna.co.uk
Wed Jan 31 04:41:38 PST 2007
Hi Jeff
The difference between Subversion and Perforce in this instance is
interesting.
I personally find it can be very useful to know that (in Perforce) file1 has
10 revisions and file2 has 53 revisions. Of course if I want a consistent
snapshot or configuration then I group them together by specifying a
changelist. However, the difference in revisions between files at the same
changelist is a simple indicator of churn which conveys useful information
at times. Thus I prefer the Perforce distinction - although it does require
a little explanation (particularly if coming from Subversion). It is not im
my experience difficult for people
When training I tend to use the following definition:
- the history of a file is revisions (each of which has an associated
changelist)
- the history of a folder (or repository) is a list of changelists
Both views are useful at different times.
A couple of other things below:
> Just to wrap this up, the problem was of course my confusion
> between revision number and changelist number. After years
> of subversion (where there is no such distinction), the
> habit is hard to break.
>
> My mistake was "confirmed" by the following:
>
> terra% p4 diff Makefile#1499 Makefile#1186
> Makefile#1499 - file(s) up-to-date.
> Makefile#1186 - file(s) up-to-date.
The diff command compares a file in the workspace against a file in the
repository, so normally you would do "p4 diff Makefile" and it would compare
your local version with the latest (head) revision. If you go "p4 diff
Makefile#1499" it compares your local one with #1499 (if it exists).
In the above case you are performing two comparisons: local Makefile vs.
Makefile#1499 and local Makefile vs. Makefile#1186
Note that diff2 takes 2 arguments, and compares both arguments *in the
repository*.
I agree the message could be clearer - worth emailing support about this.
> Just try it with any file 'foo' under version control, with
> any revision numbers:
>
> % p4 diff foo#9999999 foo#100000000
> foo#9999999 - file(s) up-to-date.
> foo#100000000 - file(s) up-to-date.
>
> Had it not been for this (IMO) misleading output, I likely
> would have realized my mistake sooner and would not have
> bothered this list.
> What is the meaning of this output, anyway? Isn't it a bug?
In my view it is not good error handling.
> Also, I think the unintended 'wrong' answers from a few
> folks here regarding '#' verses '@' makes a pretty solid
> case that the 'revision'
> and 'changelist number' concepts should be combined (as in
> subversion). I don't mean to sound trollish; I just don't
> see a compelling reason for the distinction. If they were
> combined, my hassles would have been avoided altogether.
Ah but you are just applying Subversion thinking to Perforce as discussed
above. All systems have their differences.
HTH
Robert
More information about the perforce-user
mailing list