[PATCH 4 of 4] mq: Add --rev argument to qimport, to adopt existing changesets
Benoit Boissinot
benoit.boissinot at ens-lyon.org
Tue Sep 19 07:27:39 UTC 2006
On Tue, Sep 19, 2006 at 12:15:28AM -0700, Brendan Cully wrote:
> Here is another update with a more comprehensive test suite (and no
> custom revrange function).
>
> # HG changeset patch
> # User Brendan Cully <brendan at kublai.com>
> # Date 1158650041 25200
> # Node ID e805d5be56b20dd2d02c9e88f3aa825a0966529d
> # Parent 0c0e9adfc6ae5eaf9b00bfcf5550dea0e0923105
> mq: Add --rev argument to qimport, to adopt existing changesets.
>
> diff --git a/hgext/mq.py b/hgext/mq.py
> --- a/hgext/mq.py
> +++ b/hgext/mq.py
> @@ -1247,39 +1247,102 @@ class queue:
> p = str(self.series.index(pname)) + " " + pname
> return p
>
> - def qimport(self, repo, files, patch=None, existing=None, force=None):
> - if len(files) > 1 and patch:
> + def qimport(self, repo, files, patchname=None, rev=None, existing=None,
> + force=None):
> + revs = []
> + if rev:
> + if files:
> + raise util.Abort(_('option "-r" not valid when importing '
> + 'files'))
> + revs = [int(r) for r in cmdutil.revrange(self.ui, repo, rev)]
> + revs.sort()
> + if revs[0] < revs[-1]:
always True ? (since it is sorted)
> + revs.reverse()
By the way, it would have been easier to review if you did the
s/patch/patchname/ in a separate patch.
Cheers,
Benoit
--
powered by bash/screen/(urxvt/fvwm|linux-console)/gentoo/gnu/linux OS
More information about the Mercurial
mailing list