[PATCH 1 of 4 stable] shelve: remove unused variable assignment

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Thu Oct 31 10:22:09 CDT 2013


At Thu, 31 Oct 2013 08:42:01 -0400,
Augie Fackler wrote:
> 
> On Mon, Oct 28, 2013 at 11:00:52PM +0100, Mads Kiilerich wrote:
> > # HG changeset patch
> > # User Mads Kiilerich <madski at unity3d.com>
> > # Date 1382995940 -3600
> > #      Mon Oct 28 22:32:20 2013 +0100
> > # Branch stable
> > # Node ID a45cf16389bcf2fb64dd95047bf0357e8313c83c
> > # Parent  1d7a36ff2615e6e12ce65681db4e07622e7b60d1
> > shelve: remove unused variable assignment
> 
> Dropping this one, it breaks shelve, at least with foozy's patches
> applied.

This patch breaks shelve, even if my patches are not applied.

"readshelvedfiles()" invocation here is requierd to ensure that
shelved changes named as specified exist after that line.

So, checking like below should be done, if "readshelvedfiles()"
invocation is removed.

    diff -r 15ec2bc8fa65 hgext/shelve.py
    --- a/hgext/shelve.py   Thu Oct 31 23:47:42 2013 +0900
    +++ b/hgext/shelve.py   Fri Nov 01 00:08:19 2013 +0900
    @@ -523,7 +523,8 @@
         else:
             basename = shelved[0]
    
    -    shelvedfiles = readshelvedfiles(repo, basename)
    +    if not shelvedfile(repo, basename, 'files').exists():
    +        raise util.Abort(_("shelved change '%s' not found") % basename)
    
         wlock = lock = tr = None
         try:

BTW, definition of "readshelvedfiles()" itself also seems removable,
because it is only referred by the removed line.


> >
> > Fix test-check-pyflakes.t error after 1d7a36ff2615.
> >
> > diff --git a/hgext/shelve.py b/hgext/shelve.py
> > --- a/hgext/shelve.py
> > +++ b/hgext/shelve.py
> > @@ -532,8 +532,6 @@
> >      else:
> >          basename = shelved[0]
> >
> > -    shelvedfiles = readshelvedfiles(repo, basename)
> > -
> >      wlock = lock = tr = None
> >      try:
> >          lock = repo.lock()
> > _______________________________________________
> > Mercurial-devel mailing list
> > Mercurial-devel at selenic.com
> > http://selenic.com/mailman/listinfo/mercurial-devel
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
> 

----------------------------------------------------------------------
[FUJIWARA Katsunori]                             foozy at lares.dti.ne.jp


More information about the Mercurial-devel mailing list