changeset 30395:b573d7ca31c4

shelve: move shelve-finishing logic to a separate function With future obs-based shelve, finishing shelve will be different from just aborting a transaction and I would like to keep both variants of this functionality in a separate function.
author Kostia Balytskyi <ikostia@fb.com>
date Thu, 10 Nov 2016 03:15:41 -0800
parents 21a75b63c10e
children ff896733c66a
files hgext/shelve.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/shelve.py	Thu Nov 10 03:20:28 2016 -0800
+++ b/hgext/shelve.py	Thu Nov 10 03:15:41 2016 -0800
@@ -342,6 +342,9 @@
         extra['shelve_unknown'] = '\0'.join(s.unknown)
         repo[None].add(s.unknown)
 
+def _finishshelve(repo):
+    _aborttransaction(repo)
+
 def _docreatecmd(ui, repo, pats, opts):
     wctx = repo[None]
     parents = wctx.parents()
@@ -399,7 +402,7 @@
         if origbranch != repo['.'].branch() and not _isbareshelve(pats, opts):
             repo.dirstate.setbranch(origbranch)
 
-        _aborttransaction(repo)
+        _finishshelve(repo)
     finally:
         lockmod.release(tr, lock)