unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Oleksandr Gavenko <gavenkoa@gmail.com>
To: Glenn Morris <rgm@gnu.org>
Cc: 13004@debbugs.gnu.org
Subject: bug#13004: 24.2; vc-diff from vc-log doesn't show diff before renames (for Mercurial backend).
Date: Tue, 27 Nov 2012 22:51:50 +0200	[thread overview]
Message-ID: <87wqx693bt.fsf@gavenkoa.example.com> (raw)
In-Reply-To: <xa7gp6vmd0.fsf@fencepost.gnu.org> (Glenn Morris's message of "Tue, 27 Nov 2012 15:09:47 -0500")

On 2012-11-27, Glenn Morris wrote:

> Oleksandr Gavenko wrote:
>
>>   md /tmp/test
>>   hg init
>>   echo xxx >>README
>>   hg add
>>   hg ci -m init
>>   echo yyy >>README
>>   hg ci -m before
>>   hg mv README INSTALL
>>   hg ci -m rename
>>   echo zzz >>INSTALL
>>   hg ci -m after
>
> Perfect, thanks. (Assuming md == mkdir && cd)
>
>> Open INSTALL file in Emacs. "C-x v l" ("vc-print-log"). You get (I drop some
>> output):
>
> I had to add -f to vc-hg-log-switches. I'm guessing you have it in .hgrc
> maybe.
>
Yes.

>> In changeset 2 "d" (log-view-diff) fine:
>>
>>   diff --git a/README b/INSTALL
>>   copy from README
>>   copy to INSTALL
>
> I had to add --git to vc-hg-diff-switches.
>
>> In changeset 1 "d" (log-view-diff) fail: empty *vc-diff* buffer and message:
>>
>>   Finding changes in /tmp/test/INSTALL...
>>   No changes between 0 and 1
> [...]
>>   $ hg diff -r 1 -r 2 INSTALL
>>   diff --git a/README b/INSTALL
>>   copy from README
>>   copy to INSTALL
>
> Obviously to compare with what you are asking Emacs to do, you need to run:
>
> hg diff -r 0 -r 1 INSTALL
>
> This prints nothing for me.
>
> So I don't see any Emacs issue here.

Sorry. My fail. I understand that...

I put proxy utility to logging Emacs calls to 'hg':

  #!/bin/sh
  echo "$@" >>~/tmp/hg.log
  /usr/bin/hg "$@"

so seen:

  "diff" "-r" "0" "-r" "1" "INSTALL"

Next I reread "hg help diff". Previously I make call:

  $ hg diff -r 1 INSTALL

but actually mean with "-c":

  $ hg diff -c 1 INSTALL

But that command print nothing... So you right that I misunderstand.

I surprised that Mercurial doesn't allow follow history per file. Actually it
handle renames as special case for merges.

In case of SVN - Emacs work as I expect (more precisely I hoped that HG work
as SVN):

  mkdir /tmp/test-svn
  cd /tmp/test-svn
  svnadmin create server-repo
  svn co file:///tmp/test-svn/server-repo/ local-repo
  cd local-repo
  echo xxx >>README
  svn add README
  svn ci -m init
  echo yyy >>README
  svn ci -m before1
  echo mmm >>README
  svn ci -m before2
  svn mv README INSTALL
  svn ci -m rename
  echo zzz >>INSTALL
  svn ci -m after

So for revision r3 "before2" I get diff:

  Index: README
  ===================================================================
  --- README	(revision 2)
  +++ README	(revision 3)
  @@ -1,2 +1,3 @@
   xxx
   yyy
  +mmm

  "svn"  "diff" "-r" "2:3" "INSTALL"

So for revision r2 "before1" I get diff:

  Index: README
  ===================================================================
  --- README	(revision 1)
  +++ README	(revision 2)
  @@ -1 +1,2 @@
   xxx
  +yyy

  svn "diff" "-r" "1:2" "INSTALL"


**PS** Why Emacs uses -r R1 -r R2 for HG? "-c" - do job more better as it
       actually compares to its first parent.

-- 
Best regards!





  reply	other threads:[~2012-11-27 20:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-26 18:29 bug#13004: 24.2; vc-diff from vc-log doesn't show diff before renames (for Mercurial backend) Oleksandr Gavenko
2012-11-26 21:46 ` Glenn Morris
2012-11-26 21:49   ` Glenn Morris
2012-11-26 21:54     ` Glenn Morris
2012-11-26 21:56       ` Glenn Morris
2012-11-27 19:27         ` Oleksandr Gavenko
2012-11-27 20:09           ` Glenn Morris
2012-11-27 20:51             ` Oleksandr Gavenko [this message]
2012-11-28 20:26               ` Glenn Morris
2023-12-15 21:09       ` Dmitry Gutov
2012-11-27 21:01 ` Oleksandr Gavenko
2012-11-28 20:29   ` Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wqx693bt.fsf@gavenkoa.example.com \
    --to=gavenkoa@gmail.com \
    --cc=13004@debbugs.gnu.org \
    --cc=rgm@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).