Patchwork [05,of,10] largefiles: refactor overridepull internals

login
register
mail settings
Submitter Mads Kiilerich
Date April 15, 2013, 7:23 p.m.
Message ID <d31981da545c40c77e12.1366053838@mk-desktop>
Download mbox | patch
Permalink /patch/1322/
State Accepted
Commit 864232481e76572cadad3ced9450a33a57acbc09
Headers show

Comments

Mads Kiilerich - April 15, 2013, 7:23 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1365983683 -7200
#      Mon Apr 15 01:54:43 2013 +0200
# Node ID d31981da545c40c77e1296d591acefad459c5df7
# Parent  4630416134f12f4b2e97c4bd923c1e208744487b
largefiles: refactor overridepull internals

Patch

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -704,6 +704,9 @@ 
 # working copy
 def overridepull(orig, ui, repo, source=None, **opts):
     revsprepull = len(repo)
+    if not source:
+        source = 'default'
+    repo.lfpullsource = source
     if opts.get('rebase', False):
         repo._isrebasing = True
         try:
@@ -717,9 +720,6 @@ 
             def _dummy(*args, **kwargs):
                 pass
             commands.postincoming = _dummy
-            if not source:
-                source = 'default'
-            repo.lfpullsource = source
             try:
                 result = commands.pull(ui, repo, source, **opts)
             finally:
@@ -730,9 +730,6 @@ 
         finally:
             repo._isrebasing = False
     else:
-        if not source:
-            source = 'default'
-        repo.lfpullsource = source
         oldheads = lfutil.getcurrentheads(repo)
         result = orig(ui, repo, source, **opts)
         if opts.get('cache_largefiles'):
@@ -750,8 +747,8 @@ 
                 (cached, missing) = lfcommands.cachelfiles(ui, repo, head)
                 numcached += len(cached)
             ui.status(_("%d largefiles cached\n") % numcached)
+    revspostpull = len(repo)
     if opts.get('all_largefiles'):
-        revspostpull = len(repo)
         revs = []
         for rev in xrange(revsprepull, revspostpull):
             revs.append(repo[rev].rev())