Mercurial > public > mercurial-scm > hg
comparison mercurial/subrepo.py @ 24134:afed5d2e7985
revert: display full subrepo output with --dry-run
Since the point of --dry-run is to show what will happen, the output with and
without it should agree. And since revert wasn't being called on subrepos with
--dry-run before, revert in the subrepo had to be defanged in this case.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sat, 07 Feb 2015 21:47:28 -0500 |
parents | b5898bf7119a |
children | 27b6d41aa029 |
comparison
equal
deleted
inserted
replaced
24133:79c2c29c71ae | 24134:afed5d2e7985 |
---|---|
882 if not opts.get('all'): | 882 if not opts.get('all'): |
883 pats = ['set:modified()'] | 883 pats = ['set:modified()'] |
884 self.filerevert(*pats, **opts) | 884 self.filerevert(*pats, **opts) |
885 | 885 |
886 # Update the repo to the revision specified in the given substate | 886 # Update the repo to the revision specified in the given substate |
887 self.get(substate, overwrite=True) | 887 if not opts.get('dry_run'): |
888 self.get(substate, overwrite=True) | |
888 | 889 |
889 def filerevert(self, *pats, **opts): | 890 def filerevert(self, *pats, **opts): |
890 ctx = self._repo[opts['rev']] | 891 ctx = self._repo[opts['rev']] |
891 parents = self._repo.dirstate.parents() | 892 parents = self._repo.dirstate.parents() |
892 if opts.get('all'): | 893 if opts.get('all'): |
1691 self.ui.note(_('saving current version of %s as %s\n') % | 1692 self.ui.note(_('saving current version of %s as %s\n') % |
1692 (name, bakname)) | 1693 (name, bakname)) |
1693 util.rename(os.path.join(self._abspath, name), | 1694 util.rename(os.path.join(self._abspath, name), |
1694 os.path.join(self._abspath, bakname)) | 1695 os.path.join(self._abspath, bakname)) |
1695 | 1696 |
1696 self.get(substate, overwrite=True) | 1697 if not opts.get('dry_run'): |
1698 self.get(substate, overwrite=True) | |
1697 return [] | 1699 return [] |
1698 | 1700 |
1699 def shortid(self, revid): | 1701 def shortid(self, revid): |
1700 return revid[:7] | 1702 return revid[:7] |
1701 | 1703 |