Patchwork largefiles: call super class method with proper kwargs to respect API

login
register
mail settings
Submitter Long Vu
Date Dec. 3, 2013, 7:12 p.m.
Message ID <578ea1b0a8e2ed1f88c8.1386097937@lvu.mtl.intelerad.com>
Download mbox | patch
Permalink /patch/3204/
State Accepted
Commit c5f0574034ef3304b4834312f1e651f321d0516a
Headers show

Comments

Long Vu - Dec. 3, 2013, 7:12 p.m.
# HG changeset patch
# User Long Vu <long@tlvu.ca>
# Date 1386095284 18000
#      Tue Dec 03 13:28:04 2013 -0500
# Node ID 578ea1b0a8e2ed1f88c82cbb37c236f993508a85
# Parent  1c92524c37cdd251c1a36b2da0fb4148b0e6ba09
largefiles: call super class method with proper kwargs to respect API

Since the localrepositoyry.push() method in mercurial/localrepo.py is defined
this way:

  def push(self, remote, force=False, revs=None, newbranch=False):

it is better for largefiles to call push() on the super class with proper
kwargs to respect the API.

This will avoid breaking other extensions overriding the push method this way:

  def push(self, remote, force=False, **kwargs):
Matt Mackall - Dec. 4, 2013, 7:14 p.m.
On Tue, 2013-12-03 at 14:12 -0500, Long Vu wrote:
> # HG changeset patch
> # User Long Vu <long@tlvu.ca>
> # Date 1386095284 18000
> #      Tue Dec 03 13:28:04 2013 -0500
> # Node ID 578ea1b0a8e2ed1f88c82cbb37c236f993508a85
> # Parent  1c92524c37cdd251c1a36b2da0fb4148b0e6ba09
> largefiles: call super class method with proper kwargs to respect API

Queued for default, thanks.

Patch

diff --git a/hgext/largefiles/reposetup.py b/hgext/largefiles/reposetup.py
--- a/hgext/largefiles/reposetup.py
+++ b/hgext/largefiles/reposetup.py
@@ -445,8 +445,8 @@ 
                              for f in files
                              if lfutil.isstandin(f) and f in ctx]))
                 lfcommands.uploadlfiles(ui, self, remote, toupload)
-            return super(lfilesrepo, self).push(remote, force, revs,
-                newbranch)
+            return super(lfilesrepo, self).push(remote, force=force, revs=revs,
+                newbranch=newbranch)
 
         def _subdirlfs(self, files, lfiles):
             '''