--- a/hgext/obsolete.py Wed Jul 25 19:14:18 2012 +0200
+++ b/hgext/obsolete.py Wed Jul 25 19:23:43 2012 +0200
@@ -554,15 +554,6 @@
ui.warn(_('Working directory parent is obsolete\n'))
return res
-def wrapmaycreateobsmarker(origfn, ui, repo, *args, **opts):
- lock = repo.lock()
- try:
- res = origfn(ui, repo, *args, **opts)
- repo._turn_extinct_secret()
- finally:
- lock.release()
- return res
-
def warnobserrors(orig, ui, repo, *args, **kwargs):
"""display warning is the command resulted in more instable changeset"""
priorunstables = len(repo.revs('unstable()'))
@@ -585,10 +576,6 @@
if newconflictings > 0:
ui.warn(_('%i new conflictings changesets\n') % newconflictings)
-def noextinctsvisibleheads(orig, repo):
- repo._turn_extinct_secret()
- return orig(repo)
-
def wrapcmdutilamend(orig, ui, repo, commitfunc, old, *args, **kwargs):
oldnode = old.node()
new = orig(ui, repo, commitfunc, old, *args, **kwargs)
@@ -604,7 +591,6 @@
repo.obsstore.create(tr, oldnode, [new], 0, meta)
tr.close()
repo._clearobsoletecache()
- repo._turn_extinct_secret()
finally:
tr.release()
finally:
@@ -614,11 +600,9 @@
def uisetup(ui):
extensions.wrapcommand(commands.table, "update", wrapmayobsoletewc)
extensions.wrapcommand(commands.table, "pull", wrapmayobsoletewc)
- extensions.wrapcommand(commands.table, "debugobsolete", wrapmaycreateobsmarker)
if util.safehasattr(cmdutil, 'amend'):
extensions.wrapfunction(cmdutil, 'amend', wrapcmdutilamend)
extensions.wrapfunction(discovery, 'checkheads', wrapcheckheads)
- extensions.wrapfunction(discovery, 'visibleheads', noextinctsvisibleheads)
extensions.wrapfunction(phases, 'advanceboundary', wrapclearcache)
### serialisation
@@ -689,9 +673,7 @@
if not util.safehasattr(repo.opener, 'tryread'):
raise util.Abort('Obsolete extension require Mercurial 2.2 (or later)')
- opull = repo.pull
opush = repo.push
- olock = repo.lock
o_rollback = repo._rollback
o_updatebranchcache = repo.updatebranchcache
@@ -812,7 +794,6 @@
mid = self.obsstore.create(tr, obj, subs, 0, meta)
tr.close()
self._clearobsoletecache()
- self._turn_extinct_secret()
return mid
finally:
tr.release()
@@ -828,30 +809,10 @@
for n in oldnodes:
self.addobsolete(newnode, n)
- def _turn_extinct_secret(self):
- """ensure all extinct changeset are secret"""
- self._clearobsoletecache()
- # this is mainly for safety purpose
- # both pull and push
- query = '(obsolete() - obsolete()::(unstable() - secret())) - secret()'
- expobs = [c.node() for c in repo.set(query)]
- phases.retractboundary(repo, 2, expobs)
-
### pull // push support
- def pull(self, remote, *args, **kwargs):
- """wrapper around push that push obsolete relation"""
- l = repo.lock()
- try:
- result = opull(remote, *args, **kwargs)
- self._turn_extinct_secret()
- return result
- finally:
- l.release()
-
def push(self, remote, *args, **opts):
"""wrapper around pull that pull obsolete relation"""
- self._turn_extinct_secret()
try:
result = opush(remote, *args, **opts)
except util.Abort, ex:
@@ -861,7 +822,6 @@
and ex.hint is None):
ex.hint = hint
raise
- self._turn_extinct_secret()
return result