[PATCH RFC] mq: support "qimport --existing --name renametothis thatexistingpatch"

Nicolas Dumazet nicdumz at gmail.com
Thu Jul 22 21:50:55 CDT 2010


On Thu, 22 Jul 2010 11:01:08 -0500
Matt Mackall <mpm at selenic.com> wrote:

> On Thu, 2010-07-22 at 10:00 +0900, Nicolas Dumazet wrote:
> > Hello!
> > 
> > 2010/7/22 Bill Barry <after.fallout at gmail.com>:
> > > Can the documentation be nudged around to suggest this one?
> > > from:
> > >     hg qimport [-e] [-n NAME] [-f] [-g] [-P] [-r REV]... FILE...
> > > to:
> > >     hg qimport [-e] FILE [-r REV] [-n NAME] [-f] [-g] [-P] ...
> > >
> > > (suggesting "qimport -r REV -n newname" as well)
> > 
> > I would not be too happy about that. FILE should be last. If you want
> > we can move [-e] to be just before FILE, something like:
> >        hg qimport [-f] [-g] [-P] [-r REV] [-n NAME] [-e]... FILE...
> > 
> > Maybe we can change FILE by [FILE [FILE ...] ] or something of the
> > like, and/or specify that position does not matter, and/or give
> > examples.
> > 
> > FILE in fact in not compulsory, as "qimport -r REV" works
> 
> I think it would be better to simply add an example usage to the help
> text. We need more of those.

What about:

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -1806,6 +1806,16 @@
     To import a patch from standard input, pass - as the patch file.
     When importing from standard input, a patch name must be specified
     using the --name flag.
+
+    You can import a patch existing inside the patch repository and
+    rename it on the go::
+
+      hg qimport -e -n new-name existing-patch
+
+    Note that order of arguments does not matter, and the same can be
+    achieved with::
+
+      hg qimport -e existing-patch -n new-name
     """
     q = repo.mq
     try:

?

It could also be "Combine -e and -n to import a patch..."

I'm afraid that if I only use the second example, users could think
that -e requires an argument. And then achieving a
  "qimport -e one-patch another yet-another"
would sound difficult, and that user would probably use the loaded
  "qimport -e one-patch -e another -e yet-another"
Do we need that second example? (I'm fine with only the first one)

-Nicolas.

> 
> -- 
> Mathematics is the supreme nostalgia of our time.
> 
> 


-- 
Nicolas Dumazet — NicDumZ


More information about the Mercurial-devel mailing list