all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#14168: 24.3.50; vc: Incorrect 'vc-bzr-print-log' when 'start-revision' and 'limit' are set
@ 2013-04-09 19:17 Lluís Vilanova
  2013-04-09 19:43 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Lluís Vilanova @ 2013-04-09 19:17 UTC (permalink / raw)
  To: 14168

According to vc.el (when describing 'print-log'):

   If START-REVISION is given, then show the log starting from the
   revision.

Instead, the bazaar backend shows revisions since the beginning of the file's
history, up to the given revision.

To fix this, the line using 'start-revision' should read:

	    (when start-revision (list (format "-r%s.." start-revision)))

Instead of the current:

	    (when start-revision (list (format "-r..%s" start-revision)))


Thanks,
  Lluis





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#14168: 24.3.50; vc: Incorrect 'vc-bzr-print-log' when 'start-revision' and 'limit' are set
  2013-04-09 19:17 bug#14168: 24.3.50; vc: Incorrect 'vc-bzr-print-log' when 'start-revision' and 'limit' are set Lluís Vilanova
@ 2013-04-09 19:43 ` Eli Zaretskii
  2013-04-09 19:50   ` Lluís Vilanova
       [not found] ` <handler.14168.B.136553563617274.ack@debbugs.gnu.org>
       [not found] ` <handler.14168.D14168.136679158415888.notifdone@debbugs.gnu.org>
  2 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2013-04-09 19:43 UTC (permalink / raw)
  To: Lluís Vilanova; +Cc: 14168

> From: Lluís Vilanova <vilanova@ac.upc.edu>
> Date: Tue, 09 Apr 2013 21:17:35 +0200
> 
> According to vc.el (when describing 'print-log'):
> 
>    If START-REVISION is given, then show the log starting from the
>    revision.
> 
> Instead, the bazaar backend shows revisions since the beginning of the file's
> history, up to the given revision.

Are you sure this isn't a confusion about what is meant by "starting
from the revision"?






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#14168: vc: [bzr] Properly limit revisions in 'vc-bzr-print-log'
       [not found] ` <handler.14168.B.136553563617274.ack@debbugs.gnu.org>
@ 2013-04-09 19:47   ` Lluís Vilanova
  0 siblings, 0 replies; 9+ messages in thread
From: Lluís Vilanova @ 2013-04-09 19:47 UTC (permalink / raw)
  To: 14168

Bazaar's log command supports the "--forward" argument, which can be set in
bazaar's configuration file (beyond emacs' knowledge; e.g. using the alias
"log = log --forward"). This explains why the current implementation is breaking
the declared generic semantics (by assuming "--forward" is not being used).

This can be fixed by changing it into:

            (if (and start-revision (= limit 1))
                (list (format "-c%s" start-revision))
              (append
               (when start-revision (list (format "-r%s.." start-revision)))
               (when limit (list "-l" (format "%s" limit)))))

Note that this will still break if both are given and limit is different from 1
(in which case "-c" cannot be used), but this is explicitly forbidden by the
generic semantics.


Thanks,
  Lluis





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#14168: 24.3.50; vc: Incorrect 'vc-bzr-print-log' when 'start-revision' and 'limit' are set
  2013-04-09 19:43 ` Eli Zaretskii
@ 2013-04-09 19:50   ` Lluís Vilanova
  2013-04-21  2:35     ` Glenn Morris
  0 siblings, 1 reply; 9+ messages in thread
From: Lluís Vilanova @ 2013-04-09 19:50 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 14168

Eli Zaretskii writes:

>> From: Lluís Vilanova <vilanova@ac.upc.edu>
>> Date: Tue, 09 Apr 2013 21:17:35 +0200
>> 
>> According to vc.el (when describing 'print-log'):
>> 
>> If START-REVISION is given, then show the log starting from the
>> revision.
>> 
>> Instead, the bazaar backend shows revisions since the beginning of the file's
>> history, up to the given revision.

> Are you sure this isn't a confusion about what is meant by "starting
> from the revision"?

Might well be. I understand it as "from given revision to newest
revision".

In any case, it breaks if the user adds the "--forward" argument. See my other
reply to the bug (which should be changed according to the meaning of "starting
from the revision").


Thanks,
  Lluis





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#14168: 24.3.50; vc: Incorrect 'vc-bzr-print-log' when 'start-revision' and 'limit' are set
  2013-04-09 19:50   ` Lluís Vilanova
@ 2013-04-21  2:35     ` Glenn Morris
  2013-04-21 18:57       ` Lluís Vilanova
  0 siblings, 1 reply; 9+ messages in thread
From: Glenn Morris @ 2013-04-21  2:35 UTC (permalink / raw)
  To: Lluís Vilanova; +Cc: 14168

Lluís Vilanova wrote:

>> Are you sure this isn't a confusion about what is meant by "starting
>> from the revision"?
>
> Might well be. I understand it as "from given revision to newest
> revision".

This area is confusing. It is not well documented and inconsistently
implemented. The only documentation we have is in the commentary of
vc.el:

;;   If START-REVISION is given, then show the log starting from the
;;   revision.  At this point START-REVISION is only required to work
;;   in conjunction with LIMIT = 1.

This does not make it clear whether START-REVISION is the earliest or
latest revision. If we look at the implementations we see:

bzr  -r..start -l limit
    start is the latest revision
    show from newest to oldest
    show limit revisions

git  -n limit start
    start is the latest revision
    show from newest to oldest
    show limit revisions

hg   -rstart: -l limit
    start is the earliest revision
    show from oldest to newest
    show limit revisions

    for consistency with bzr and git, seems this should be -rstart:0  ?

svn  -rstart --limit limit
    show only single revision start
    limit is ignored

    for consistency with bzr and git, seems this should be -rstart:1 ?

mtn  --from start --last limit
    dunno what this does


In practice, the only place in Emacs that uses this is
vc-annotate-show-log-revision-at-line, which shows a single revision
only. So we have no way to tell what the intended behaviour is when
LIMIT != 1.

We should either document that it only works for LIMIT = 1, or decide
what it is supposed to do and make it consistent.
I'm guessing that START was supposed to be the newest revision, which is
the opposite of what I (like you) first thought.


I have no idea how to sensibly combine this with someone having "bzr log"
aliased to "bzr log --forward".

   bzr log --forward -r ..3 --limit 2 

will display revisions 1 and 2 rather than 2 and 3. There doesn't seem
to be a simple way to get the latter.

https://lists.ubuntu.com/archives/bazaar/2007q4/035828.html
   You are correct that the --limit option does not make much sense with
   the --forward option.  It is not meant to.
https://bugs.launchpad.net/bzr/+bug/320920

I don't know if we should bother trying to figure it out given that the
only caller of this uses LIMIT == 1. I'd probably just stick a
--no-aliases in there.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#14168: 24.3.50; vc: Incorrect 'vc-bzr-print-log' when 'start-revision' and 'limit' are set
  2013-04-21  2:35     ` Glenn Morris
@ 2013-04-21 18:57       ` Lluís Vilanova
  2013-04-24  8:14         ` Glenn Morris
  0 siblings, 1 reply; 9+ messages in thread
From: Lluís Vilanova @ 2013-04-21 18:57 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 14168

Glenn Morris writes:

> Lluís Vilanova wrote:
>>> Are you sure this isn't a confusion about what is meant by "starting
>>> from the revision"?
>> 
>> Might well be. I understand it as "from given revision to newest
>> revision".

> This area is confusing. It is not well documented and inconsistently
> implemented. The only documentation we have is in the commentary of
> vc.el:
[...]
> In practice, the only place in Emacs that uses this is
> vc-annotate-show-log-revision-at-line, which shows a single revision
> only. So we have no way to tell what the intended behaviour is when
> LIMIT != 1.

> We should either document that it only works for LIMIT = 1, or decide
> what it is supposed to do and make it consistent.
> I'm guessing that START was supposed to be the newest revision, which is
> the opposite of what I (like you) first thought.


> I have no idea how to sensibly combine this with someone having "bzr log"
> aliased to "bzr log --forward".

>    bzr log --forward -r ..3 --limit 2 

> will display revisions 1 and 2 rather than 2 and 3. There doesn't seem
> to be a simple way to get the latter.

> https://lists.ubuntu.com/archives/bazaar/2007q4/035828.html
>    You are correct that the --limit option does not make much sense with
>    the --forward option.  It is not meant to.
> https://bugs.launchpad.net/bzr/+bug/320920

> I don't know if we should bother trying to figure it out given that the
> only caller of this uses LIMIT == 1. I'd probably just stick a
> --no-aliases in there.

Nice, I didn't know about the "--no-aliases" argument, and that might prove
useful. As a side note, I sent a small patch for the case where LIMIT is 1.

Looking at the code, I'd rather rename START-REVISION as REVISION, which I think
would be less confusing given the current semantics.

Lluis





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#14168: 24.3.50; vc: Incorrect 'vc-bzr-print-log' when 'start-revision' and 'limit' are set
  2013-04-21 18:57       ` Lluís Vilanova
@ 2013-04-24  8:14         ` Glenn Morris
  0 siblings, 0 replies; 9+ messages in thread
From: Glenn Morris @ 2013-04-24  8:14 UTC (permalink / raw)
  To: 14168-done

Version: 24.4

Hopefully improved in trunk.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#14168: closed (Re: bug#14168: 24.3.50; vc: Incorrect 'vc-bzr-print-log' when 'start-revision' and 'limit' are set)
       [not found] ` <handler.14168.D14168.136679158415888.notifdone@debbugs.gnu.org>
@ 2013-04-24 12:58   ` Lluís Vilanova
  2013-04-24 16:41     ` Glenn Morris
  0 siblings, 1 reply; 9+ messages in thread
From: Lluís Vilanova @ 2013-04-24 12:58 UTC (permalink / raw)
  To: 14168

Wouldn't this break when aliases are present and limit is 1? AFAIK, this is the
case in which I found out the "error".





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#14168: closed (Re: bug#14168: 24.3.50; vc: Incorrect 'vc-bzr-print-log' when 'start-revision' and 'limit' are set)
  2013-04-24 12:58   ` bug#14168: closed (Re: bug#14168: 24.3.50; vc: Incorrect 'vc-bzr-print-log' when 'start-revision' and 'limit' are set) Lluís Vilanova
@ 2013-04-24 16:41     ` Glenn Morris
  0 siblings, 0 replies; 9+ messages in thread
From: Glenn Morris @ 2013-04-24 16:41 UTC (permalink / raw)
  To: Lluís Vilanova; +Cc: 14168

Lluís Vilanova wrote:

> Wouldn't this break when aliases are present and limit is 1? AFAIK,
> this is the case in which I found out the "error".

Yeah, sorry, I realized that later. Will fix.





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-04-24 16:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-09 19:17 bug#14168: 24.3.50; vc: Incorrect 'vc-bzr-print-log' when 'start-revision' and 'limit' are set Lluís Vilanova
2013-04-09 19:43 ` Eli Zaretskii
2013-04-09 19:50   ` Lluís Vilanova
2013-04-21  2:35     ` Glenn Morris
2013-04-21 18:57       ` Lluís Vilanova
2013-04-24  8:14         ` Glenn Morris
     [not found] ` <handler.14168.B.136553563617274.ack@debbugs.gnu.org>
2013-04-09 19:47   ` bug#14168: vc: [bzr] Properly limit revisions in 'vc-bzr-print-log' Lluís Vilanova
     [not found] ` <handler.14168.D14168.136679158415888.notifdone@debbugs.gnu.org>
2013-04-24 12:58   ` bug#14168: closed (Re: bug#14168: 24.3.50; vc: Incorrect 'vc-bzr-print-log' when 'start-revision' and 'limit' are set) Lluís Vilanova
2013-04-24 16:41     ` Glenn Morris

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.