Show More
@@ -2801,7 +2801,7 def revert(ui, repo, ctx, parents, *pats | |||
|
2801 | 2801 | if targetsubs: |
|
2802 | 2802 | # Revert the subrepos on the revert list |
|
2803 | 2803 | for sub in targetsubs: |
|
2804 |
ctx.sub(sub).revert( |
|
|
2804 | ctx.sub(sub).revert(ctx.substate[sub], *pats, **opts) | |
|
2805 | 2805 | finally: |
|
2806 | 2806 | wlock.release() |
|
2807 | 2807 |
@@ -506,8 +506,8 class abstractsubrepo(object): | |||
|
506 | 506 | """ |
|
507 | 507 | return 1 |
|
508 | 508 | |
|
509 |
def revert(self |
|
|
510 | ui.warn('%s: reverting %s subrepos is unsupported\n' \ | |
|
509 | def revert(self, substate, *pats, **opts): | |
|
510 | self.ui.warn('%s: reverting %s subrepos is unsupported\n' \ | |
|
511 | 511 | % (substate[0], substate[2])) |
|
512 | 512 | return [] |
|
513 | 513 | |
@@ -861,13 +861,13 class hgsubrepo(abstractsubrepo): | |||
|
861 | 861 | subrepos) |
|
862 | 862 | |
|
863 | 863 | @annotatesubrepoerror |
|
864 |
def revert(self |
|
|
864 | def revert(self, substate, *pats, **opts): | |
|
865 | 865 | # reverting a subrepo is a 2 step process: |
|
866 | 866 | # 1. if the no_backup is not set, revert all modified |
|
867 | 867 | # files inside the subrepo |
|
868 | 868 | # 2. update the subrepo to the revision specified in |
|
869 | 869 | # the corresponding substate dictionary |
|
870 | ui.status(_('reverting subrepo %s\n') % substate[0]) | |
|
870 | self.ui.status(_('reverting subrepo %s\n') % substate[0]) | |
|
871 | 871 | if not opts.get('no_backup'): |
|
872 | 872 | # Revert all files on the subrepo, creating backups |
|
873 | 873 | # Note that this will not recursively revert subrepos |
@@ -879,19 +879,19 class hgsubrepo(abstractsubrepo): | |||
|
879 | 879 | pats = [] |
|
880 | 880 | if not opts.get('all'): |
|
881 | 881 | pats = ['set:modified()'] |
|
882 |
self.filerevert( |
|
|
882 | self.filerevert(*pats, **opts) | |
|
883 | 883 | |
|
884 | 884 | # Update the repo to the revision specified in the given substate |
|
885 | 885 | self.get(substate, overwrite=True) |
|
886 | 886 | |
|
887 |
def filerevert(self |
|
|
887 | def filerevert(self, *pats, **opts): | |
|
888 | 888 | ctx = self._repo[opts['rev']] |
|
889 | 889 | parents = self._repo.dirstate.parents() |
|
890 | 890 | if opts.get('all'): |
|
891 | 891 | pats = ['set:modified()'] |
|
892 | 892 | else: |
|
893 | 893 | pats = [] |
|
894 | cmdutil.revert(ui, self._repo, ctx, parents, *pats, **opts) | |
|
894 | cmdutil.revert(self.ui, self._repo, ctx, parents, *pats, **opts) | |
|
895 | 895 | |
|
896 | 896 | def shortid(self, revid): |
|
897 | 897 | return revid[:12] |
General Comments 0
You need to be logged in to leave comments.
Login now