[PATCH] hgweb: follow renames and copies in file log (issue1576)

Martin Geisler mg at aragost.com
Thu Apr 7 07:12:05 CDT 2011


Benoit Boissinot <bboissin at gmail.com> writes:

> On Thu, Apr 7, 2011 at 1:45 PM, Martin Geisler <mg at aragost.com> wrote:
>> Matt Mackall <mpm at selenic.com> writes:
>>
>>> Similarly, it'd be highly confusing if hg log's default output were
>>> tied to the current working directory contents, especially if the
>>> working directory were in the 'past', thus causing future changes not
>>> to be shown.
>>
>> You may think so, but it's not as clear cut as that. I know you don't
>> "speak Git", but if you look at Git, then you'll see that they do infact
>> use the equivalent of 'hg log -f' by default.
>
> Are you sure? There is a --follow flag as well.

I tested it by making a couple of commits, then updating to an earlier
commit and looking at the log:

  $ git init repo
  Initialized empty Git repository in /home/mg/tmp/repo/.git/
  $ cd repo
  $ echo a > a.txt
  $ git add a.txt
  $ git commit -a -m a1
  [master (root-commit) 438a685] a1
   1 files changed, 1 insertions(+), 0 deletions(-)
   create mode 100644 a.txt
  $ echo a >> a.txt
  $ git commit -a -m a2
  [master a56d520] a2
   1 files changed, 1 insertions(+), 0 deletions(-)
  $ echo a >> a.txt
  $ git commit -a -m a3
  [master f10c149] a3
   1 files changed, 1 insertions(+), 0 deletions(-)

The full log with three commits:

  $ git log --graph
  * commit f10c149eaa17df4c8eeb22b4a5556583017a4582
  | Author: Martin Geisler <mg at aragost.com>
  | Date:   Thu Apr 7 14:07:44 2011 +0200
  |
  |     a3
  |
  * commit a56d520e5dcc777f5fd846065976579aed37cbc6
  | Author: Martin Geisler <mg at aragost.com>
  | Date:   Thu Apr 7 14:07:41 2011 +0200
  |
  |     a2
  |
  * commit 438a6851f726c61292434a6322fd7025aae5db50
    Author: Martin Geisler <mg at aragost.com>
    Date:   Thu Apr 7 14:07:36 2011 +0200

        a1

Updating the working copy to an earlier commit:

  $ git checkout a56d52
  Note: checking out 'a56d52'.

  You are in 'detached HEAD' state. You can look around, make experimental
  changes and commit them, and you can discard any commits you make in this
  state without impacting any branches by performing another checkout.

  If you want to create a new branch to retain commits you create, you may
  do so (now or later) by using -b with the checkout command again. Example:

    git checkout -b new_branch_name

  HEAD is now at a56d520... a2

The log output is now attached to the second commit:

  $ git log --graph
  * commit a56d520e5dcc777f5fd846065976579aed37cbc6
  | Author: Martin Geisler <mg at aragost.com>
  | Date:   Thu Apr 7 14:07:41 2011 +0200
  |
  |     a2
  |
  * commit 438a6851f726c61292434a6322fd7025aae5db50
    Author: Martin Geisler <mg at aragost.com>
    Date:   Thu Apr 7 14:07:36 2011 +0200

        a1


I also tested it with a new branch and again Git only showed the
changesets that were relevant, meaning that it only showed the
changesets on the branch that my working copy was on.

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://mercurial.aragost.com/kick-start/


More information about the Mercurial-devel mailing list