[PATCH] shelve: allow unlimited shelved changes per name

Jun Wu quark at fb.com
Wed Jun 21 01:20:27 EDT 2017


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1498020963 25200
#      Tue Jun 20 21:56:03 2017 -0700
# Node ID 24898c57d4e20dbe0e601fa350b835b9e5b5ab7b
# Parent  0ce2cbebd74964ffe61e79de8941461bccc9371b
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 24898c57d4e2
shelve: allow unlimited shelved changes per name

diff --git a/hgext/shelve.py b/hgext/shelve.py
--- a/hgext/shelve.py
+++ b/hgext/shelve.py
@@ -317,5 +317,5 @@ def getshelvename(repo, parent, opts):
     def gennames():
         yield label
-        for i in xrange(1, 100):
+        for i in itertools.count(1):
             yield '%s-%02d' % (label, i)
     name = opts.get('name')
@@ -344,6 +344,4 @@ def getshelvename(repo, parent, opts):
                 name = n
                 break
-        else:
-            raise error.Abort(_("too many shelved changes named '%s'") % label)
 
     return name


More information about the Mercurial-devel mailing list