[PATCH 1 of 2] revert: add support for reverting subrepos

Patrick Mézard patrick at mezard.eu
Tue Apr 17 11:57:28 CDT 2012


Le 15/04/12 00:49, Angel Ezquerra a écrit :
> # HG changeset patch
> # User Angel Ezquerra <angel.ezquerra at gmail.com>
> # Date 1332927737 -7200
> # Node ID 6952d4ae3b3d1af884ef8f98dbd78ed5db3abd3b
> # Parent  eb13533a7849604864f42fb7eae3d8f11f0e7ea7
> revert: add support for reverting subrepos
> 
> Reverting a subrepo is done by updating it to the revision that is selected on
> the parent repo .hgsubstate file.
> 
> * ISSUES/TODO:
> 
> - reverting added and removed subrepos is not supported yet.
> - reverting subrepos is only supported if the --no-backup flag is used (this
> limitation will be removed on another patch).
> - The behavior of the --all flag has been changed. It now reverts subrepos as
> well. Note that this may lead to data loss if the user has a dirty subrepo.
> 
> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
> --- a/mercurial/cmdutil.py
> +++ b/mercurial/cmdutil.py
> @@ -1356,8 +1356,6 @@
>              if path in names:
>                  return
>              if path in repo[node].substate:
> -                ui.warn("%s: %s\n" % (m.rel(path),
> -                    'reverting subrepos is unsupported'))
>                  return
>              path_ = path + '/'
>              for f in names:

Should not we keep at least a warning if the subrepo type does not implement revert?

--
Patrick Mézard


More information about the Mercurial-devel mailing list