hg mv old new equivalent to mv old new hg addremove

Uwe Brauer oub at mat.ucm.es
Mon Jul 27 15:01:57 UTC 2020


>>> "RW" == Rainer Woitok <rainer.woitok at gmail.com> writes:

Rainer,


   > Uwe,
   > On Sunday, 2020-07-26 19:14:53 +0200, you wrote:

   >> ...
   >> I presume hg mv is «safer» in that sense. But what information does it
   >> preserve? 

   > The information that one file  is just a rename of the other,  which is,
   > for instance, utilized by "hg log -f".   If you just move a file outside
   > of Mercurial,  the old file  will just  cease to exist  and the new file
   > will just spring into existence  without noting that the old file is the
   > predecessor of the new one.

Sorry to nag, but the following scripts seem to produce an identical
result:
,----
| hg init
| echo "First" > test.org
| hg add test.org
| hg commit  -m "First"
| echo "Second" >> test.org
| hg commit  -m "Second"
| echo "Third" >> test.org
| hg commit  -m "Third"
| echo "Forth" >> test.org
| hg commit  -m "Forth"
| hg mv test.org testnew.org
| hg commit  -m "Renamed file test.org to testnew.org"
| hg log -f testnew.org
`----


,----
| hg init
| echo "First" > test.org
| hg add test.org
| hg commit  -m "First"
| echo "Second" >> test.org
| hg commit  -m "Second"
| echo "Third" >> test.org
| hg commit  -m "Third"
| echo "Forth" >> test.org
| hg commit  -m "Forth"
| mv test.org testnew.org
| hg addremove
| hg commit  -m "Renamed file test.org to testnew.org"
| hg log -f testnew.org
`----


Uwe 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5673 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20200727/07a9a3fd/attachment.p7s>


More information about the Mercurial mailing list