Patchwork shelve: make no_backup parameter passing python 2.4 compatible

login
register
mail settings
Submitter David Soria Parra
Date Oct. 2, 2013, 7:50 a.m.
Message ID <84f1c5762b869310d9c2.1380700238@achird.localdomain>
Download mbox | patch
Permalink /patch/2689/
State Accepted
Commit 821a89018f17fd4c121652388a37e3bf4f43298c
Headers show

Comments

David Soria Parra - Oct. 2, 2013, 7:50 a.m.
# HG changeset patch
# User David Soria Parra <dsp@experimentalworks.net>
# Date 1380700221 -7200
#      Wed Oct 02 09:50:21 2013 +0200
# Node ID 84f1c5762b869310d9c2dd8ea33ba9aecda5fb8e
# Parent  5855de925923648eed889772bb3704c28da22ec4
shelve: make no_backup parameter passing python 2.4 compatible

Python 2.4 doesn't allow passing named parameter after an list unpack,
but allows to unpack a dict.
Matt Mackall - Oct. 2, 2013, 6:33 p.m.
On Wed, 2013-10-02 at 09:50 +0200, David Soria Parra wrote:
> # HG changeset patch
> # User David Soria Parra <dsp@experimentalworks.net>
> # Date 1380700221 -7200
> #      Wed Oct 02 09:50:21 2013 +0200
> # Node ID 84f1c5762b869310d9c2dd8ea33ba9aecda5fb8e
> # Parent  5855de925923648eed889772bb3704c28da22ec4
> shelve: make no_backup parameter passing python 2.4 compatible

This is horrible. Queued for default, thanks.

Patch

diff --git a/hgext/shelve.py b/hgext/shelve.py
--- a/hgext/shelve.py
+++ b/hgext/shelve.py
@@ -346,7 +346,7 @@ 
             revertfiles = readshelvedfiles(repo, state.name)
             wctx = repo.parents()[0]
             cmdutil.revert(ui, repo, wctx, [wctx.node(), nullid],
-                           *revertfiles, no_backup=True)
+                           *revertfiles, **{'no_backup': True})
             # fix up the weird dirstate states the merge left behind
             mf = wctx.manifest()
             dirstate = repo.dirstate
@@ -508,7 +508,7 @@ 
                 revertfiles = set(parents[1].files()).difference(ms)
                 cmdutil.revert(ui, repo, parents[1],
                                (parents[0].node(), nullid),
-                               *revertfiles, no_backup=True)
+                               *revertfiles, **{'no_backup': True})
                 raise error.InterventionRequired(
                     _("unresolved conflicts (see 'hg resolve', then "
                       "'hg unshelve --continue')"))
@@ -517,7 +517,7 @@ 
             parent = tip.parents()[0]
             hg.update(repo, parent.node())
             cmdutil.revert(ui, repo, tip, repo.dirstate.parents(), *tip.files(),
-                           no_backup=True)
+                           **{'no_backup': True})
 
         prevquiet = ui.quiet
         ui.quiet = True