Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHGc999d246e48c: py3: handle keyword arguments correctly in subrepo.py
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
| hg-reviewers |
| Lint Skipped |
| Unit Tests Skipped |
| def _getstorehashcachename(remotepath): | def _getstorehashcachename(remotepath): | ||||
| '''get a unique filename for the store hash cache of a remote repository''' | '''get a unique filename for the store hash cache of a remote repository''' | ||||
| return hashlib.sha1(_expandedabspath(remotepath)).hexdigest()[0:12] | return hashlib.sha1(_expandedabspath(remotepath)).hexdigest()[0:12] | ||||
| class SubrepoAbort(error.Abort): | class SubrepoAbort(error.Abort): | ||||
| """Exception class used to avoid handling a subrepo error more than once""" | """Exception class used to avoid handling a subrepo error more than once""" | ||||
| def __init__(self, *args, **kw): | def __init__(self, *args, **kw): | ||||
| self.subrepo = kw.pop('subrepo', None) | self.subrepo = kw.pop(r'subrepo', None) | ||||
| self.cause = kw.pop('cause', None) | self.cause = kw.pop(r'cause', None) | ||||
| error.Abort.__init__(self, *args, **kw) | error.Abort.__init__(self, *args, **kw) | ||||
| def annotatesubrepoerror(func): | def annotatesubrepoerror(func): | ||||
| def decoratedmethod(self, *args, **kargs): | def decoratedmethod(self, *args, **kargs): | ||||
| try: | try: | ||||
| res = func(self, *args, **kargs) | res = func(self, *args, **kargs) | ||||
| except SubrepoAbort as ex: | except SubrepoAbort as ex: | ||||
| # This exception has already been handled | # This exception has already been handled | ||||
| % self._path) | % self._path) | ||||
| def _svncommand(self, commands, filename='', failok=False): | def _svncommand(self, commands, filename='', failok=False): | ||||
| cmd = [self._exe] | cmd = [self._exe] | ||||
| extrakw = {} | extrakw = {} | ||||
| if not self.ui.interactive(): | if not self.ui.interactive(): | ||||
| # Making stdin be a pipe should prevent svn from behaving | # Making stdin be a pipe should prevent svn from behaving | ||||
| # interactively even if we can't pass --non-interactive. | # interactively even if we can't pass --non-interactive. | ||||
| extrakw['stdin'] = subprocess.PIPE | extrakw[r'stdin'] = subprocess.PIPE | ||||
| # Starting in svn 1.5 --non-interactive is a global flag | # Starting in svn 1.5 --non-interactive is a global flag | ||||
| # instead of being per-command, but we need to support 1.4 so | # instead of being per-command, but we need to support 1.4 so | ||||
| # we have to be intelligent about what commands take | # we have to be intelligent about what commands take | ||||
| # --non-interactive. | # --non-interactive. | ||||
| if commands[0] in ('update', 'checkout', 'commit'): | if commands[0] in ('update', 'checkout', 'commit'): | ||||
| cmd.append('--non-interactive') | cmd.append('--non-interactive') | ||||
| cmd.extend(commands) | cmd.extend(commands) | ||||
| if filename is not None: | if filename is not None: | ||||