Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG7fda2a8ed24e: py3: use pycompat.{bytes|str}kwargs in transplant.py
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
| hg-reviewers |
| Lint Skipped |
| Unit Tests Skipped |
| def __init__(self, ui, repo, opts): | def __init__(self, ui, repo, opts): | ||||
| self.ui = ui | self.ui = ui | ||||
| self.path = repo.vfs.join('transplant') | self.path = repo.vfs.join('transplant') | ||||
| self.opener = vfsmod.vfs(self.path) | self.opener = vfsmod.vfs(self.path) | ||||
| self.transplants = transplants(self.path, 'transplants', | self.transplants = transplants(self.path, 'transplants', | ||||
| opener=self.opener) | opener=self.opener) | ||||
| def getcommiteditor(): | def getcommiteditor(): | ||||
| editform = cmdutil.mergeeditform(repo[None], 'transplant') | editform = cmdutil.mergeeditform(repo[None], 'transplant') | ||||
| return cmdutil.getcommiteditor(editform=editform, **opts) | return cmdutil.getcommiteditor(editform=editform, | ||||
| **pycompat.strkwargs(opts)) | |||||
| self.getcommiteditor = getcommiteditor | self.getcommiteditor = getcommiteditor | ||||
| def applied(self, repo, node, parent): | def applied(self, repo, node, parent): | ||||
| '''returns True if a node is already an ancestor of parent | '''returns True if a node is already an ancestor of parent | ||||
| or is parent or has already been transplanted''' | or is parent or has already been transplanted''' | ||||
| if hasnode(repo, parent): | if hasnode(repo, parent): | ||||
| parentrev = repo.changelog.rev(parent) | parentrev = repo.changelog.rev(parent) | ||||
| if hasnode(repo, node): | if hasnode(repo, node): | ||||
| 'list provided')) | 'list provided')) | ||||
| if opts.get('all'): | if opts.get('all'): | ||||
| if not opts.get('branch'): | if not opts.get('branch'): | ||||
| raise error.Abort(_('--all requires a branch revision')) | raise error.Abort(_('--all requires a branch revision')) | ||||
| if revs: | if revs: | ||||
| raise error.Abort(_('--all is incompatible with a ' | raise error.Abort(_('--all is incompatible with a ' | ||||
| 'revision list')) | 'revision list')) | ||||
| opts = pycompat.byteskwargs(opts) | |||||
| checkopts(opts, revs) | checkopts(opts, revs) | ||||
| if not opts.get('log'): | if not opts.get('log'): | ||||
| # deprecated config: transplant.log | # deprecated config: transplant.log | ||||
| opts['log'] = ui.config('transplant', 'log') | opts['log'] = ui.config('transplant', 'log') | ||||
| if not opts.get('filter'): | if not opts.get('filter'): | ||||
| # deprecated config: transplant.filter | # deprecated config: transplant.filter | ||||
| opts['filter'] = ui.config('transplant', 'filter') | opts['filter'] = ui.config('transplant', 'filter') | ||||