--- a/hgext/evolve.py Tue Jun 03 01:16:39 2014 -0700
+++ b/hgext/evolve.py Mon Jun 02 14:18:29 2014 -0700
@@ -884,36 +884,34 @@
_('record the specified user in metadata'), _('USER')),
]
-if getattr(mercurial.cmdutil, 'tryimportone', None) is not None:
- # hg 3.0 and greate
- @eh.uisetup
- def _installimportobsolete(ui):
- entry = cmdutil.findcmd('import', commands.table)[1]
- entry[1].append(('', 'obsolete', False,
- _('mark the old node as obsoleted by'
- 'the created commit')))
+@eh.uisetup
+def _installimportobsolete(ui):
+ entry = cmdutil.findcmd('import', commands.table)[1]
+ entry[1].append(('', 'obsolete', False,
+ _('mark the old node as obsoleted by'
+ 'the created commit')))
- @eh.wrapfunction(mercurial.cmdutil, 'tryimportone')
- def tryimportone(orig, ui, repo, hunk, parents, opts, *args, **kwargs):
- extracted = patch.extract(ui, hunk)
- expected = extracted[5]
- oldextract = patch.extract
- try:
- patch.extract = lambda ui, hunk: extracted
- ret = orig(ui, repo, hunk, parents, opts, *args, **kwargs)
- finally:
- patch.extract = oldextract
- created = ret[1]
- if opts['obsolete'] and created is not None and created != expected:
- tr = repo.transaction('import-obs')
- try:
- metadata = {'user': ui.username()}
- repo.obsstore.create(tr, node.bin(expected), (created,),
- metadata=metadata)
- tr.close()
- finally:
- tr.release()
- return ret
+@eh.wrapfunction(mercurial.cmdutil, 'tryimportone')
+def tryimportone(orig, ui, repo, hunk, parents, opts, *args, **kwargs):
+ extracted = patch.extract(ui, hunk)
+ expected = extracted[5]
+ oldextract = patch.extract
+ try:
+ patch.extract = lambda ui, hunk: extracted
+ ret = orig(ui, repo, hunk, parents, opts, *args, **kwargs)
+ finally:
+ patch.extract = oldextract
+ created = ret[1]
+ if opts['obsolete'] and created is not None and created != expected:
+ tr = repo.transaction('import-obs')
+ try:
+ metadata = {'user': ui.username()}
+ repo.obsstore.create(tr, node.bin(expected), (created,),
+ metadata=metadata)
+ tr.close()
+ finally:
+ tr.release()
+ return ret
def _deprecatealias(oldalias, newalias):