From 1c141dad8705e27c311a1c86436131c47f49dcc9 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 24 Apr 2013 20:53:18 -0400 Subject: [PATCH] * lisp/vc/vc-bzr.el (vc-bzr-print-log): Tweak LIMIT = 1 case. --- lisp/ChangeLog | 4 ++++ lisp/vc/vc-bzr.el | 20 ++++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 23af08f872f..d6d96545165 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2013-04-25 Glenn Morris + + * vc/vc-bzr.el (vc-bzr-print-log): Tweak LIMIT = 1 case. + 2013-04-24 Stefan Monnier * progmodes/opascal.el (opascal-set-token-property): Rename from diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index 06942ad283c..4a08403c93e 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el @@ -710,12 +710,28 @@ If LIMIT is non-nil, show no more than this many entries." (apply 'vc-bzr-command "log" buffer 'async files (append (when shortlog '("--line")) - (when start-revision (list (format "-r..%s" start-revision))) + ;; The extra complications here when start-revision and limit + ;; are set are due to bzr log's --forward argument, which + ;; could be enabled via an alias in bazaar.conf. + ;; Svn, for example, does not have this problem, because + ;; it doesn't have --forward. Instead, you can use + ;; svn --log -r HEAD:0 or -r 0:HEAD as you prefer. + ;; Bzr, however, insists in -r X..Y that X come before Y. + (if start-revision + (list (format + (if (and limit (= limit 1)) + ;; This means we don't have to use --no-aliases. + ;; Is -c any different to -r in this case? + "-r%s" + "-r..%s") start-revision))) (when limit (list "-l" (format "%s" limit))) - ;; This is to remove --forward, if it has been added by an alias. ;; There is no sensible way to combine --limit and --forward, ;; and it breaks the meaning of START-REVISION as the ;; _newest_ revision. See bug#14168. + ;; Eg bzr log --forward -r ..100 --limit 50 prints + ;; revisions 1-50 rather than 50-100. There + ;; seems no way in general to get bzr to print revisions + ;; 50-100 in --forward order in that case. ;; FIXME There may be other alias stuff we want to keep. ;; Is there a way to just suppress --forward? ;; As of 2013/4 the only caller uses limit = 1, so it does -- 2.39.2