Show More
@@ -2783,14 +2783,14 b' def revert(ui, repo, ctx, parents, *pats' | |||
|
2783 | 2783 | |
|
2784 | 2784 | _performrevert(repo, parents, ctx, actions) |
|
2785 | 2785 | |
|
2786 |
|
|
|
2787 |
|
|
|
2788 |
|
|
|
2789 | ||
|
2790 |
|
|
|
2791 |
|
|
|
2792 |
|
|
|
2793 |
|
|
|
2786 | # get the list of subrepos that must be reverted | |
|
2787 | subrepomatch = scmutil.match(ctx, pats, opts) | |
|
2788 | targetsubs = sorted(s for s in ctx.substate if subrepomatch(s)) | |
|
2789 | ||
|
2790 | if targetsubs: | |
|
2791 | # Revert the subrepos on the revert list | |
|
2792 | for sub in targetsubs: | |
|
2793 | ctx.sub(sub).revert(ctx.substate[sub], *pats, **opts) | |
|
2794 | 2794 | finally: |
|
2795 | 2795 | wlock.release() |
|
2796 | 2796 |
@@ -884,7 +884,8 b' class hgsubrepo(abstractsubrepo):' | |||
|
884 | 884 | self.filerevert(*pats, **opts) |
|
885 | 885 | |
|
886 | 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 | 890 | def filerevert(self, *pats, **opts): |
|
890 | 891 | ctx = self._repo[opts['rev']] |
@@ -1693,7 +1694,8 b' class gitsubrepo(abstractsubrepo):' | |||
|
1693 | 1694 | util.rename(os.path.join(self._abspath, name), |
|
1694 | 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 | 1699 | return [] |
|
1698 | 1700 | |
|
1699 | 1701 | def shortid(self, revid): |
@@ -50,9 +50,16 b' test handling .hgsubstate "added" explic' | |||
|
50 | 50 | Revert subrepo and test subrepo fileset keyword: |
|
51 | 51 | |
|
52 | 52 | $ echo b > s/a |
|
53 | $ hg revert --dry-run "set:subrepo('glob:s*')" | |
|
54 | reverting subrepo s | |
|
55 | reverting s/a (glob) | |
|
56 | $ cat s/a | |
|
57 | b | |
|
53 | 58 | $ hg revert "set:subrepo('glob:s*')" |
|
54 | 59 | reverting subrepo s |
|
55 | 60 | reverting s/a (glob) |
|
61 | $ cat s/a | |
|
62 | a | |
|
56 | 63 | $ rm s/a.orig |
|
57 | 64 | |
|
58 | 65 | Revert subrepo with no backup. The "reverting s/a" line is gone since |
General Comments 0
You need to be logged in to leave comments.
Login now