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
=== modified file 'bzrlib/builtins.py'
--- bzrlib/builtins.py 2010-10-15 11:30:54 +0000
+++ bzrlib/builtins.py 2010-10-18 04:16:42 +0000
@@ -1866,6 +1866,13 @@
1866 "bzr diff -p1" is equivalent to "bzr diff --prefix old/:new/", and1866 "bzr diff -p1" is equivalent to "bzr diff --prefix old/:new/", and
1867 produces patches suitable for "patch -p1".1867 produces patches suitable for "patch -p1".
18681868
1869 Note that when using the -r argument with a range of revisions, the
1870 differences are computed between the two specified revisions. That
1871 is, the command does not show the changes introduced by the first
1872 revision in the range. This differs from the interpretation of
1873 revision ranges used by "bzr log" which includes the first revision
1874 in the range.
1875
1869 :Exit values:1876 :Exit values:
1870 1 - changed1877 1 - changed
1871 2 - unrepresentable changes1878 2 - unrepresentable changes
@@ -1889,7 +1896,11 @@
18891896
1890 bzr diff -r1..3 xxx1897 bzr diff -r1..3 xxx
18911898
1892 To see the changes introduced in revision X::1899 The changes introduced by revision 2 (equivalent to -r1..2)::
1900
1901 bzr diff -c2
1902
1903 To see the changes introduced by revision X::
1893 1904
1894 bzr diff -cX1905 bzr diff -cX
18951906
@@ -1899,9 +1910,10 @@
18991910
1900 bzr diff -r<chosen_parent>..X1911 bzr diff -r<chosen_parent>..X
19011912
1902 The changes introduced by revision 2 (equivalent to -r1..2)::1913 The changes between the current revision and the previous revision
1914 (equivalent to -c-1 and -r-2..-1)
19031915
1904 bzr diff -c21916 bzr diff -r-2..
19051917
1906 Show just the differences for file NEWS::1918 Show just the differences for file NEWS::
19071919
19081920
=== modified file 'doc/en/release-notes/bzr-2.3.txt'
--- doc/en/release-notes/bzr-2.3.txt 2010-10-15 15:05:09 +0000
+++ doc/en/release-notes/bzr-2.3.txt 2010-10-18 04:16:42 +0000
@@ -58,6 +58,9 @@
58Documentation58Documentation
59*************59*************
6060
61* Be more specific about the meaning of revision ranges for ``bzr diff``.
62 (Neil Martinsen-Burrell, #247282)
63
61API Changes64API Changes
62***********65***********
6366