[PATCH 5 of 7 evolve-ext] check-code: make inhibit.py comply with check-code
Laurent Charignon
lcharignon at fb.com
Fri Dec 4 17:37:15 CST 2015
# HG changeset patch
# User Laurent Charignon <lcharignon at fb.com>
# Date 1449271879 28800
# Fri Dec 04 15:31:19 2015 -0800
# Node ID f21cdd7a333a6afe85fdda30b7cabc9ac145e5f3
# Parent 2881bde0d8c6d5b0c8a17d21b865742290c83d6c
check-code: make inhibit.py comply with check-code
diff --git a/hgext/inhibit.py b/hgext/inhibit.py
--- a/hgext/inhibit.py
+++ b/hgext/inhibit.py
@@ -9,15 +9,16 @@
should probably stick on using evolution in its current state, understand its
concept and provide feedback
-This extension provides the ability to "inhibit" obsolescence markers. obsolete
-revision can be cheaply brought back to life that way.
-However as the inhibitor are not fitting in an append only model, this is
+This extension provides the ability to "inhibit" obsolescence markers. obsolete
+revision can be cheaply brought back to life that way.
+However as the inhibitor are not fitting in an append only model, this is
incompatible with sharing mutable history.
"""
from mercurial import localrepo
from mercurial import obsolete
from mercurial import extensions
from mercurial import cmdutil
+from mercurial import error
from mercurial import scmutil
from mercurial import commands
from mercurial import lock as lockmod
@@ -40,7 +41,7 @@
obsinhibit = set()
raw = self.svfs.tryread('obsinhibit')
for i in xrange(0, len(raw), 20):
- obsinhibit.add(raw[i:i+20])
+ obsinhibit.add(raw[i:i + 20])
return obsinhibit
def commit(self, *args, **kwargs):
@@ -59,7 +60,7 @@
"""
wlock = None
try:
- # Evolve is running a hook on lock release to display a warning message
+ # Evolve is running a hook on lock release to display a warning message
# if the workind dir's parent is obsolete.
# We take the lock here to make sure that we inhibit the parent before
# that hook get a chance to run.
@@ -77,10 +78,10 @@
if not haspruneopt:
return orig(ui, repo, *bookmarks, **opts)
elif opts.get('rename'):
- raise util.Abort('Cannot use both -m and -D')
+ raise error.Abort('Cannot use both -m and -D')
elif len(bookmarks) == 0:
hint = _('make sure to put a space between -D and your bookmark name')
- raise util.Abort(_('Error, please check your command'), hint=hint)
+ raise error.Abort(_('Error, please check your command'), hint=hint)
# Call prune -B
evolve = extensions.find('evolve')
@@ -184,11 +185,11 @@
def _computeobsoletenotrebasedwrap(orig, repo, rebasesetrevs, dest):
repo._notinhibited = rebasesetrevs
try:
- repo.invalidatevolatilesets()
- r = orig(repo, rebasesetrevs, dest)
+ repo.invalidatevolatilesets()
+ r = orig(repo, rebasesetrevs, dest)
finally:
- del repo._notinhibited
- repo.invalidatevolatilesets()
+ del repo._notinhibited
+ repo.invalidatevolatilesets()
return r
def transactioncallback(orig, repo, desc, *args, **kwargs):
@@ -203,7 +204,8 @@
_inhibitmarkers(repo, [repo[r].node() for r in visibleobsolete])
transaction = orig(repo, desc, *args, **kwargs)
if desc != 'strip' and _inhibitenabled(repo):
- transaction.addpostclose('inhibitposttransaction', inhibitposttransaction)
+ transaction.addpostclose('inhibitposttransaction',
+ inhibitposttransaction)
return transaction
def extsetup(ui):
More information about the Mercurial-devel
mailing list