find renamed files (with addremove)

Uwe Brauer oub at mat.ucm.es
Sat Jul 28 16:38:27 UTC 2018


>>> "Augie" == Augie Fackler <lists at durin42.com> writes:

   > On Mon, Jul 16, 2018 at 5:36 AM, Uwe Brauer <oub at mat.ucm.es> wrote:
   >> Hi
   >> 2. hg log -r "adds(Seeker.txt)" --template "{file_copies}"
   >> that works for me in some (test) repos, but in my problematic
   >> one I obtain hg: parse error: adds requires a pattern

   > Can you give us a sample invocation that actually fails? It sounds
   > like you're trying adds() with no arg, which won't work...


First I tried this on a fresh new test repo.

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"
mv test.org neu.org
hg addremove
hg commit -m "Moved file name"
hg log -r "adds(neu.org)" --template "{file_copies}"

Which returns

neu.org (test.org)

Which is precisely what I was expecting. 

Now I return to the repo which really interests me.

I know (!) That I renamed in a similar way the file 

 sec1-cont-flow-hs.tex 

(I don't know how I named this file earlier).

So by the same logic I run 

hg log -r "adds(sec1-cont-flow-hs.tex)" --template "{file_copies}"
but obtain


hg: parse error: adds requires a pattern

I am stuck. 

What is going on?
Ok I found it: he does not like the "-" in the name.

Try this 

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"
mv test.org test-2.org
hg addremove
hg commit -m "Moved file name"
hg log -r "adds(test-2.org)" --template "{file_copies}"

And you will obtain 


hg: parse error: adds requires a pattern

Any ideas how to solve this. Because I use - in names quite often.


Uwe Brauer 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5025 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20180728/4dbc0adf/attachment.p7s>


More information about the Mercurial mailing list