Patchwork shelve: allow unlimited shelved changes per name

login
register
mail settings
Submitter Jun Wu
Date June 21, 2017, 5:20 a.m.
Message ID <24898c57d4e20dbe0e60.1498022427@x1c>
Download mbox | patch
Permalink /patch/21578/
State Changes Requested
Headers show

Comments

Jun Wu - June 21, 2017, 5:20 a.m.
# HG changeset patch
# User Jun Wu <quark@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
via Mercurial-devel - June 21, 2017, 5:40 a.m.
On Tue, Jun 20, 2017 at 10:20 PM, Jun Wu <quark@fb.com> wrote:
> # HG changeset patch
> # User Jun Wu <quark@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

Similar comment here: please explain why the patch is right. We have
discussed it on IRC and I did some digging myself earlier, but it's
helpful for the reviewers if you can share your findings with them so
they don't also have to do the same digging. We don't have many
reviewers on this list, so we need to use their time wisely.

Concretely, you could mention that the limit has been there since the
shelve extension was added in 49d4919d21. I think it would also be
helpful to give some background on what the limit is about. Do you
have any idea why the 100-shelve limit was there? Even if you don't,
that's useful information to know (i.e. that you have no idea what the
limit was for).

>
> 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
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

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