Patchwork [01,of,12,misc,largefiles] largefiles: import whole modules instead of importing parts of them

login
register
mail settings
Submitter Mads Kiilerich
Date April 13, 2014, 4:59 p.m.
Message ID <1e6fdce9da05ca458777.1397408344@localhost.localdomain>
Download mbox | patch
Permalink /patch/4317/
State Accepted
Commit 70252bdfd39cc839a11982c5a5750e2d22eb62ed
Headers show

Comments

Mads Kiilerich - April 13, 2014, 4:59 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1396910916 -7200
#      Tue Apr 08 00:48:36 2014 +0200
# Node ID 1e6fdce9da05ca45877770f6a487962026ae9baa
# Parent  40800668e01921e41db1eb97d19e473971e93f5e
largefiles: import whole modules instead of importing parts of them

Be more friendly to demandimport.

Patch

diff --git a/hgext/largefiles/proto.py b/hgext/largefiles/proto.py
--- a/hgext/largefiles/proto.py
+++ b/hgext/largefiles/proto.py
@@ -8,7 +8,6 @@  import urllib2
 import re
 
 from mercurial import error, httppeer, util, wireproto
-from mercurial.wireproto import batchable, future
 from mercurial.i18n import _
 
 import lfutil
@@ -135,9 +134,9 @@  def wirereposetup(ui, repo):
                     self._abort(error.ResponseError(_("unexpected response:"),
                                                     chunk))
 
-        @batchable
+        @wireproto.batchable
         def statlfile(self, sha):
-            f = future()
+            f = wireproto.future()
             result = {'sha': sha}
             yield result, f
             try:
diff --git a/hgext/largefiles/remotestore.py b/hgext/largefiles/remotestore.py
--- a/hgext/largefiles/remotestore.py
+++ b/hgext/largefiles/remotestore.py
@@ -8,9 +8,8 @@ 
 
 import urllib2
 
-from mercurial import util
+from mercurial import util, wireproto
 from mercurial.i18n import _
-from mercurial.wireproto import remotebatch
 
 import lfutil
 import basestore
@@ -97,4 +96,4 @@  class remotestore(basestore.basestore):
 
     def batch(self):
         '''Support for remote batching.'''
-        return remotebatch(self)
+        return wireproto.remotebatch(self)
diff --git a/hgext/largefiles/uisetup.py b/hgext/largefiles/uisetup.py
--- a/hgext/largefiles/uisetup.py
+++ b/hgext/largefiles/uisetup.py
@@ -9,10 +9,9 @@ 
 '''setup for largefiles extension: uisetup'''
 
 from mercurial import archival, cmdutil, commands, extensions, filemerge, hg, \
-    httppeer, merge, scmutil, sshpeer, wireproto, revset
+    httppeer, merge, scmutil, sshpeer, wireproto, revset, subrepo
 from mercurial.i18n import _
 from mercurial.hgweb import hgweb_mod, webcommands
-from mercurial.subrepo import hgsubrepo
 
 import overrides
 import proto
@@ -42,7 +41,7 @@  def uisetup(ui):
     # Subrepos call status function
     entry = extensions.wrapcommand(commands.table, 'status',
                                    overrides.overridestatus)
-    entry = extensions.wrapfunction(hgsubrepo, 'status',
+    entry = extensions.wrapfunction(subrepo.hgsubrepo, 'status',
                                     overrides.overridestatusfn)
 
     entry = extensions.wrapcommand(commands.table, 'log',
@@ -104,7 +103,7 @@  def uisetup(ui):
                                     overrides.overridecopy)
 
     # Summary calls dirty on the subrepos
-    entry = extensions.wrapfunction(hgsubrepo, 'dirty',
+    entry = extensions.wrapfunction(subrepo.hgsubrepo, 'dirty',
                                     overrides.overridedirty)
 
     # Backout calls revert so we need to override both the command and the
@@ -118,7 +117,8 @@  def uisetup(ui):
     extensions.wrapfunction(hg, 'merge', overrides.hgmerge)
 
     extensions.wrapfunction(archival, 'archive', overrides.overridearchive)
-    extensions.wrapfunction(hgsubrepo, 'archive', overrides.hgsubrepoarchive)
+    extensions.wrapfunction(subrepo.hgsubrepo, 'archive',
+                            overrides.hgsubrepoarchive)
     extensions.wrapfunction(cmdutil, 'bailifchanged',
                             overrides.overridebailifchanged)