tiny bug: conflict of qcommit and qrename
Patrick Mézard
pmezard at gmail.com
Fri Jun 6 11:34:15 CDT 2008
Weijun Wang a écrit :
> Inside an empty directory, run these commands:
>
> hg init; hg qinit -c; hg qnew x; hg qrename y; hg qcommit
>
> and there's an error. The reason is that after "hg qnew x" there's a "hg
> add x" called inside the q repo. However, after the qrename, the patch
> file name is changed and qcommit cannot find it.
>
> I have a patch for it:
>
> --- a/hgext/mq.py Wed Jun 04 11:22:08 2008 +0800
> +++ b/hgext/mq.py Wed Jun 04 11:51:01 2008 +0800
> @@ -2038,10 +2038,14 @@
> if r:
> wlock = r.wlock()
> try:
> - if r.dirstate[name] == 'r':
> - r.undelete([name])
> - r.copy(patch, name)
> - r.remove([patch], False)
> + if r.dirstate[patch] == 'a':
> + r.dirstate.forget(patch)
> + r.dirstate.add(name)
> + else:
> + if r.dirstate[name] == 'r':
> + r.undelete([name])
> + r.copy(patch, name)
> + r.remove([patch], False)
> finally:
> del wlock
In crew-stable and crew as 2519976a998b, thanks !
--
Patrick Mézard
More information about the Mercurial
mailing list