Mercurial > public > mercurial-scm > hg-stable
diff mercurial/cmdutil.py @ 16430:6883c2363f44
revert: add support for reverting subrepos without --no-backup and/or --all
When a subrepo is reverted but --no-backup is not set, call revert on the
subrepo that is being reverted prior to updating it to the revision specified
in the parent repo's .hgsubstate file.
The --all flag is passed down to the subrepo when it is being reverted. If the
--all flag is not set, all files that are modified on the subrepo will be
reverted.
author | Angel Ezquerra <angel.ezquerra@gmail.com> |
---|---|
date | Wed, 28 Mar 2012 11:42:17 +0200 |
parents | 71dcce391a44 |
children | 55982f62651f |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Wed Mar 28 11:42:17 2012 +0200 +++ b/mercurial/cmdutil.py Wed Mar 28 11:42:17 2012 +0200 @@ -1369,11 +1369,8 @@ if abs not in names: names[abs] = m.rel(abs), m.exact(abs) + # get the list of subrepos that must be reverted targetsubs = [s for s in repo[node].substate if m(s)] - if targetsubs and not opts.get('no_backup'): - msg = _("cannot revert subrepos without --no-backup") - raise util.Abort(msg) - m = scmutil.matchfiles(repo, names) changes = repo.status(match=m)[:4] modified, added, removed, deleted = map(set, changes)