Merge lp:~nmb/bzr/247282-diff-log into lp:bzr

Proposed by Neil Martinsen-Burrell
Status: Merged
Approved by: Vincent Ladeuil
Approved revision: no longer in the source branch.
Merged at revision: 5507
Proposed branch: lp:~nmb/bzr/247282-diff-log
Merge into: lp:bzr
Diff against target: 56 lines (+18/-3)
2 files modified
bzrlib/builtins.py (+15/-3)
doc/en/release-notes/bzr-2.3.txt (+3/-0)
To merge this branch: bzr merge lp:~nmb/bzr/247282-diff-log
Reviewer Review Type Date Requested Status
Vincent Ladeuil Approve
Review via email: mp+38691@code.launchpad.net

Commit message

Document revision ranges for diff.

Description of the change

This adds documentation on the meaning of revision ranges for the diff command, specifically the different meaning of those ranges between log and diff.

To post a comment you must log in.
Revision history for this message
Vincent Ladeuil (vila) wrote :

That's a long awaited clarification ;) This won't certainly put an end about *why* we did implement it differently, but istm that most of our users don't really care as long as it's documented.

review: Approve
Revision history for this message
Vincent Ladeuil (vila) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/builtins.py'
2--- bzrlib/builtins.py 2010-10-15 11:30:54 +0000
3+++ bzrlib/builtins.py 2010-10-18 04:16:42 +0000
4@@ -1866,6 +1866,13 @@
5 "bzr diff -p1" is equivalent to "bzr diff --prefix old/:new/", and
6 produces patches suitable for "patch -p1".
7
8+ Note that when using the -r argument with a range of revisions, the
9+ differences are computed between the two specified revisions. That
10+ is, the command does not show the changes introduced by the first
11+ revision in the range. This differs from the interpretation of
12+ revision ranges used by "bzr log" which includes the first revision
13+ in the range.
14+
15 :Exit values:
16 1 - changed
17 2 - unrepresentable changes
18@@ -1889,7 +1896,11 @@
19
20 bzr diff -r1..3 xxx
21
22- To see the changes introduced in revision X::
23+ The changes introduced by revision 2 (equivalent to -r1..2)::
24+
25+ bzr diff -c2
26+
27+ To see the changes introduced by revision X::
28
29 bzr diff -cX
30
31@@ -1899,9 +1910,10 @@
32
33 bzr diff -r<chosen_parent>..X
34
35- The changes introduced by revision 2 (equivalent to -r1..2)::
36+ The changes between the current revision and the previous revision
37+ (equivalent to -c-1 and -r-2..-1)
38
39- bzr diff -c2
40+ bzr diff -r-2..
41
42 Show just the differences for file NEWS::
43
44
45=== modified file 'doc/en/release-notes/bzr-2.3.txt'
46--- doc/en/release-notes/bzr-2.3.txt 2010-10-15 15:05:09 +0000
47+++ doc/en/release-notes/bzr-2.3.txt 2010-10-18 04:16:42 +0000
48@@ -58,6 +58,9 @@
49 Documentation
50 *************
51
52+* Be more specific about the meaning of revision ranges for ``bzr diff``.
53+ (Neil Martinsen-Burrell, #247282)
54+
55 API Changes
56 ***********
57