largefiles: refactor overridepull internals
authorMads Kiilerich <madski@unity3d.com>
Mon, 15 Apr 2013 01:54:43 +0200
changeset 18977 864232481e76
parent 18976 6734951e2d24
child 18978 8abaadab9abb
largefiles: refactor overridepull internals
hgext/largefiles/overrides.py
--- 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())