"hg qpush" fails when REMOVED symlink in patch

Ted Pavlic ted at tedpavlic.com
Sun Dec 14 09:43:58 CST 2008


Could someone verify this problem? It's really annoying to me right now, 
and if there's something wrong that I'm doing that I can fix, that would 
be helpful.

Thanks --
Ted

On 12/13/08 4:42 PM, Ted Pavlic wrote:
> I think I found a bug in qpush, and I am almost positive that this bug
> did not exist before Mercurial 1.1.
>
> If I have an MQ patch that *removes* a symlink, when I push the patch
> with "mq push", "mq push" fails and produces the reject file:
>
> --- sym_link
> +++ sym_link
> @@ -1,1 +0,0 @@
> -a_file
> \ No newline at end of file
>
> Consider the following script:
>
> =====
> #!/bin/sh -x
>
> hg version
> mkdir mq_test_one
> cd mq_test_one
> hg init
> touch a_file
> ln -s a_file sym_link
> hg add a_file sym_link
> hg commit -m "Added file and link"
> hg remove sym_link
> hg commit -m "Removed link"
> hg qinit
> hg qimport -r tip
> hg qpop
> hg qpush -v
> cat *.rej
> =====
>
> I get the output from it:
>
> =====
> + hg version
> Mercurial Distributed SCM (version 1.1)
>
> Copyright (C) 2005-2008 Matt Mackall<mpm at selenic.com>  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.
> + mkdir mq_test_one
> + cd mq_test_one
> + hg init
> + touch a_file
> + ln -s a_file sym_link
> + hg add a_file sym_link
> + hg commit -m 'Added file and link'
> + hg remove sym_link
> + hg commit -m 'Removed link'
> + hg qinit
> + hg qimport -r tip
> + hg qpop
> Patch queue now empty
> + hg qpush -v
> applying 1.diff
> patching file sym_link
> Hunk #1 FAILED at 0
> 1 out of 1 hunks FAILED -- saving rejects to file sym_link.rej
> patch failed to apply
> patch failed, rejects left in working dir
> Errors during apply, please fix and refresh 1.diff
> + cat sym_link.rej
> --- sym_link
> +++ sym_link
> @@ -1,1 +0,0 @@
> -a_file
> \ No newline at end of file
> =====
>
> 	For now, it appears like if I ever want to remove a symlink, I cannot
> use MQ.
>
> 	Thanks --
> 	Ted
>
>

-- 
Ted Pavlic <ted at tedpavlic.com>


More information about the Mercurial mailing list