Does hg mv a bar/ discard a's history?

Matthias Luedtke matthias-luedtke at gmx.de
Mon Jul 16 15:35:36 CDT 2007


Hi all,

first, I owe you a big 'thank you'! From what I've seen so far,
Mercurial is a damn nice piece of software. I hope you can explain to a
newbie what's going on here:

When I create a new repository and add two files

hg init foo
cd foo/
echo a > a
mkdir bar
echo b > bar/b
hg add a bar/b
hg commit -m 'Added two lovely files, a and bar/b'

and then do a

hg log a

it yields a's history as expected, like

changeset:   0:4b105d266186
user:        Matthias Luedtke <email at matthias-luedtke.de>
date:        Mon Jul 16 22:14:06 2007 +0200
summary:     Added two lovely files, a and bar/b

However, when I move a to bar/

hg mv a bar/
hg commit -m 'Moved a to bar/'

and fetch a's history at its new place with

hg log bar/a

it just yields

changeset:   1:2128094e05a1
tag:         tip
user:        Matthias Luedtke <email at matthias-luedtke.de>
date:        Mon Jul 16 22:15:10 2007 +0200
summary:     Moved a to bar/

without a's first occurence in revision 0. I had expected something like

changeset:   1:2128094e05a1
tag:         tip
user:        Matthias Luedtke <email at matthias-luedtke.de>
date:        Mon Jul 16 22:15:10 2007 +0200
summary:     Moved a to bar/

changeset:   0:4b105d266186
user:        Matthias Luedtke <email at matthias-luedtke.de>
date:        Mon Jul 16 22:14:06 2007 +0200
summary:     Added two lovely files, a and bar/b

as I am directly arriving from Subversion Plaza where they keep a files'
history across renames and moves.

Am I doing something wrong here? Who stole the history?
Or is this behaviour desired in the shiny world of distributed SCMs?

Cheers,
mat


More information about the Mercurial mailing list