D8322: shelve: split up dounshelve() in unshelvecmd() and _dounshelve()

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

D8322: shelve: split up dounshelve() in unshelvecmd() and _dounshelve()

martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I'd like to be able to override the new `_dounshelve()`, getting
  access to the name of the shelve to unshelve. `unshelvecmd()` seems to
  better match the existing `createcmd()`, `listcmd()` etc.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8322

AFFECTED FILES
  mercurial/commands.py
  mercurial/shelve.py

CHANGE DETAILS

diff --git a/mercurial/shelve.py b/mercurial/shelve.py
--- a/mercurial/shelve.py
+++ b/mercurial/shelve.py
@@ -1074,7 +1074,7 @@
         raise error.Abort(m, hint=hint)
 
 
-def dounshelve(ui, repo, *shelved, **opts):
+def unshelvecmd(ui, repo, *shelved, **opts):
     opts = pycompat.byteskwargs(opts)
     abortf = opts.get(b'abort')
     continuef = opts.get(b'continue')
@@ -1121,6 +1121,10 @@
     if not shelvedfile(repo, basename, patchextension).exists():
         raise error.Abort(_(b"shelved change '%s' not found") % basename)
 
+    return _dounshelve(ui, repo, basename, opts)
+
+
+def _dounshelve(ui, repo, basename, opts):
     repo = repo.unfiltered()
     lock = tr = None
     try:
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -7585,7 +7585,7 @@
        unshelved.
     """
     with repo.wlock():
-        return shelvemod.dounshelve(ui, repo, *shelved, **opts)
+        return shelvemod.unshelvecmd(ui, repo, *shelved, **opts)
 
 
 statemod.addunfinished(



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D8322: shelve: split up dounshelve() in unshelvecmd() and _dounshelve()

martinvonz (Martin von Zweigbergk)
Closed by commit rHG47c1226463a1: shelve: split up dounshelve() in unshelvecmd() and _dounshelve() (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8322?vs=20865&id=20878

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8322/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8322

AFFECTED FILES
  mercurial/commands.py
  mercurial/shelve.py

CHANGE DETAILS

diff --git a/mercurial/shelve.py b/mercurial/shelve.py
--- a/mercurial/shelve.py
+++ b/mercurial/shelve.py
@@ -1074,7 +1074,7 @@
         raise error.Abort(m, hint=hint)
 
 
-def dounshelve(ui, repo, *shelved, **opts):
+def unshelvecmd(ui, repo, *shelved, **opts):
     opts = pycompat.byteskwargs(opts)
     abortf = opts.get(b'abort')
     continuef = opts.get(b'continue')
@@ -1121,6 +1121,10 @@
     if not shelvedfile(repo, basename, patchextension).exists():
         raise error.Abort(_(b"shelved change '%s' not found") % basename)
 
+    return _dounshelve(ui, repo, basename, opts)
+
+
+def _dounshelve(ui, repo, basename, opts):
     repo = repo.unfiltered()
     lock = tr = None
     try:
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -7585,7 +7585,7 @@
        unshelved.
     """
     with repo.wlock():
-        return shelvemod.dounshelve(ui, repo, *shelved, **opts)
+        return shelvemod.unshelvecmd(ui, repo, *shelved, **opts)
 
 
 statemod.addunfinished(



To: martinvonz, #hg-reviewers, Alphare
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel