[PATCH] mq: introduce the qunmanage command

Brendan Cully brendan at kublai.com
Fri May 23 13:02:50 CDT 2008


Looks good to me, but...

On Friday, 23 May 2008 at 16:22, Dirkjan Ochtman wrote:
> @@ -1496,10 +1531,8 @@
>      The patches must not be applied, unless they are arguments to
>      the --rev parameter. At least one patch or revision is required.
>  
> -    With --rev, mq will stop managing the named revisions (converting
> -    them to regular mercurial changesets). The patches must be applied
> -    and at the base of the stack. This option is useful when the patches
> -    have been applied upstream.
> +    The qunmanage command should be used as an alternative for qdel -r. The
> +    -r option to qdelete will be removed in some future release.
>  
>      With --keep, the patch files are preserved in the patch directory."""
>      q = repo.mq

This may be too strong. And I think we shouldn't actually delete the
information about --rev, even if we include the advice to use qunmanage.

> @@ -2167,6 +2200,20 @@
>          finally:
>              q.save_dirty()
>  
> +def unmanage(ui, repo, *revrange, **opts):
> +    """move revisions from mq into repository history
> +
> +    Accepts an optional revision range. If no arguments are given, all
> +    applied mq revisions are removed from mq control. The given revisions
> +    must be at the base of the stack of applied mq revisions.
> +    """
> +    q = repo.mq
> +    if not revrange:
> +        revrange = ['qbase:qtip']
> +    q.unmanage(repo, revrange)
> +    q.save_dirty()
> +    return 0
> +

I don't know if it's a good idea to automatically unmanage
everything. An operation which is at least partly destructive (you
lose your patch names) ought to take explicit arguments IMHO. But we
could add a -a/--all option.


More information about the Mercurial-devel mailing list