changeset 18977:864232481e76

largefiles: refactor overridepull internals
author Mads Kiilerich <madski@unity3d.com>
date Mon, 15 Apr 2013 01:54:43 +0200
parents 6734951e2d24
children 8abaadab9abb
files hgext/largefiles/overrides.py
diffstat 1 files changed, 4 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py	Mon Apr 15 01:53:37 2013 +0200
+++ b/hgext/largefiles/overrides.py	Mon Apr 15 01:54:43 2013 +0200
@@ -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())