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