# HG changeset patch
# User Kostia Balytskyi <ikos...@fb.com>
# Date 1484838335 28800
#      Thu Jan 19 07:05:35 2017 -0800
# Node ID 6a7e7659886d35dfdc4d7d5efb3ef8479ae35367
# Parent  088c9191d662d5c0003310119c51540926a815f7
shelve: disable inhibit for shelving period

While shelving, we're creating a new commit and updating to it.
If inhibit is enabled, it will try to add this commit to an
inhibition set, which is not necessary (we're creating a marker
right after we perform this operation). Thus, disabling inhibit
speeds things up a bit.

diff --git a/hgext/shelve.py b/hgext/shelve.py
--- a/hgext/shelve.py
+++ b/hgext/shelve.py
@@ -447,8 +447,12 @@ def _docreatecmd(ui, repo, pats, opts):
         opts['message'] = desc
 
     lock = tr = activebookmark = None
+    _obsinhibit = _notset = object()
     try:
         lock = repo.lock()
+        if util.safehasattr(repo, '_obsinhibit'):
+            _obsinhibit = getattr(repo, '_obsinhibit')
+            del repo._obsinhibit
 
         # depending on whether shelve is traditional or
         # obsolescense-based, we either abort or commit this
@@ -498,6 +502,8 @@ def _docreatecmd(ui, repo, pats, opts):
         _finishshelve(ui, repo, tr, node, activebookmark)
     finally:
         _restoreactivebookmark(repo, activebookmark)
+        if _obsinhibit is not _notset:
+            repo._obsinhibit = _obsinhibit
         lockmod.release(tr, lock)
 
 def _isbareshelve(pats, opts):
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to