[issue2874] Rename (move, mv) a file over directories -> loose diff history of the file

Sven Joerns bugs at mercurial.selenic.com
Thu Jun 30 10:06:27 CDT 2011


New submission from Sven Joerns <mercurial at sven-joerns.de>:

example to show you what I mean :

bash-3.2$ hg --version
Mercurial Distributed SCM (version 1.8.4+20110601)
(see http://mercurial.selenic.com for more information)

Copyright (C) 2005-2011 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
bash-3.2$ hg init move-example
bash-3.2$ cd move-example/
bash-3.2$ mkdir d1 d2
bash-3.2$ echo "1st line" >>file.txt
bash-3.2$ hg add d1 d2 file.txt
bash-3.2$ hg status
A file.txt
bash-3.2$ hg com -m "init ci"
bash-3.2$ hg rename file.txt d1/file.txt
bash-3.2$ hg status
A d1/file.txt
R file.txt
bash-3.2$ hg com -m "move to d1"
bash-3.2$ echo "2nd line" >> d1/file.txt
bash-3.2$ hg status
M d1/file.txt
bash-3.2$ hg com -m "insert 2nd line"
bash-3.2$ ls
d1
d2
bash-3.2$ hg diff -r 1 d1/file.txt
diff -r 9fd52915d9b6 d1/file.txt
--- a/d1/file.txt Thu Jun 30 16:34:58 2011 +0200
+++ b/d1/file.txt Thu Jun 30 16:37:05 2011 +0200
@@ -1,1 +1,2 @@
1st line
+2nd line
bash-3.2$ hg rename d1/file.txt d2/file.txt
bash-3.2$ hg status
A d2/file.txt
R d1/file.txt
bash-3.2$ ls
d2
bash-3.2$ hg com -m "move to d2"
bash-3.2$ echo "3rd line" >> d2/file.txt
bash-3.2$ hg com -m "insert 3rd line"
bash-3.2$ hg diff -r 1 d2/file.txt
diff -r 9fd52915d9b6 d2/file.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/d2/file.txt Thu Jun 30 16:39:52 2011 +0200
@@ -0,0 +1,3 @@
+1st line
+2nd line
+3rd line
bash-3.2$


3 new lines, so I lost the information of the other steps (and the directory
d1 was deleted)

----------
messages: 16647
nosy: proofy
priority: urgent
status: unread
title: Rename (move, mv) a file over directories -> loose diff history of the file
topic: diff, hg, log

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2874>
____________________________________________________


More information about the Mercurial-devel mailing list