Mercurial > public > mercurial-scm > hg
comparison mercurial/subrepo.py @ 18943:27e8dfc2c338
subrepo: fix exception on revert when "all" option is omitted
Since fafdff7e9c43, backout does not set opts['all'], which causes KeyError
at hgsubrepo.revert.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Mon, 15 Apr 2013 23:52:57 +0900 |
parents | 798bdb7f1517 |
children | ca480d710fe6 |
comparison
equal
deleted
inserted
replaced
18942:6891e361bec6 | 18943:27e8dfc2c338 |
---|---|
762 opts = opts.copy() | 762 opts = opts.copy() |
763 opts['date'] = None | 763 opts['date'] = None |
764 opts['rev'] = substate[1] | 764 opts['rev'] = substate[1] |
765 | 765 |
766 pats = [] | 766 pats = [] |
767 if not opts['all']: | 767 if not opts.get('all'): |
768 pats = ['set:modified()'] | 768 pats = ['set:modified()'] |
769 self.filerevert(ui, *pats, **opts) | 769 self.filerevert(ui, *pats, **opts) |
770 | 770 |
771 # Update the repo to the revision specified in the given substate | 771 # Update the repo to the revision specified in the given substate |
772 self.get(substate, overwrite=True) | 772 self.get(substate, overwrite=True) |
773 | 773 |
774 def filerevert(self, ui, *pats, **opts): | 774 def filerevert(self, ui, *pats, **opts): |
775 ctx = self._repo[opts['rev']] | 775 ctx = self._repo[opts['rev']] |
776 parents = self._repo.dirstate.parents() | 776 parents = self._repo.dirstate.parents() |
777 if opts['all']: | 777 if opts.get('all'): |
778 pats = ['set:modified()'] | 778 pats = ['set:modified()'] |
779 else: | 779 else: |
780 pats = [] | 780 pats = [] |
781 cmdutil.revert(ui, self._repo, ctx, parents, *pats, **opts) | 781 cmdutil.revert(ui, self._repo, ctx, parents, *pats, **opts) |
782 | 782 |