[PATCH stable] mq: fixed ENOENT when qrename to new/directory.patch

Brendan Cully brendan at kublai.com
Tue Mar 30 16:12:30 CDT 2010


On Tuesday, 30 March 2010 at 13:49, Benoit Boissinot wrote:
> On Tue, Mar 30, 2010 at 1:41 PM, Yuya Nishihara <yuya at tcha.org> wrote:
> > Benoit Boissinot wrote:
> >> On Sun, Mar 28, 2010 at 8:43 AM, Yuya Nishihara <yuya at tcha.org> wrote:
> >> >
> >> > MQ patch name can contain slashes, e.g. 'foo/bar.patch'.
> >> >
> >> > Currently "qnew foo/bar.patch" works, but
> >> > "qrename foo/bar.patch new/dir.patch" fails with
> >> > "No such file or directory".
> >>
> >> There are lots of other problems if we allow '/' in patchnames (hg
> >> qrename foo foo/bar ; hg qrename bar foo).
> >> Maybe qnew should disallow them instead?
> >
> > Hmm, but there's already the code meant to support directories:
> >
> >> changeset:   3080:82c9d1aac308
> >> user:        Brendan Cully <brendan at kublai.com>
> >> date:        Wed Sep 13 08:57:08 2006 -0700
> >> files:       hgext/mq.py tests/test-mq-qrename tests/test-mq-qrename.out
> >> description:
> >> Make qrename handle directory targets; closes #333.
> >
> > and the issue:
> >
> > http://mercurial.selenic.com/bts/issue333
> >
> > I'm okay to disallow slashes as patchnames, but is there a fun of
> > that feature?
> 
> Brendan, since you added the feature, what do you think?

I added it because there was a bug about it, not because I myself
needed the feature. So I don't have a strong opinion, but I'd still
prefer if we kept it. I think it probably helps keep large patch
series (larger than I personally use, but mq has always been meant to
handle very large series) organized.

I also think we can get away with fixing edge cases (like qrename foo
foo/bar) as we go, rather than insisting on making it handle
everything at once, as long as an unhandled case fails
gracefully. Anyway, I don't believe there are really that many cases,
and nothing that plain old hg mv shouldn't also be able to handle.


More information about the Mercurial-devel mailing list