diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -651,6 +651,7 @@ def hgmerge(orig, repo, node, force=None # take some extra care so that the largefiles are correctly updated in the # working copy def overridepull(orig, ui, repo, source=None, **opts): + revsprepull = len(repo) if opts.get('rebase', False): repo._isrebasing = True try: @@ -660,7 +661,6 @@ def overridepull(orig, ui, repo, source= 'the update flag\n') del opts['rebase'] cmdutil.bailifchanged(repo) - revsprepull = len(repo) origpostincoming = commands.postincoming def _dummy(*args, **kwargs): pass @@ -695,6 +695,12 @@ def overridepull(orig, ui, repo, source= (cached, missing) = lfcommands.cachelfiles(ui, repo, head) numcached += len(cached) ui.status(_("%d largefiles cached\n") % numcached) + if opts.get('all_largefiles'): + revspostpull = len(repo) + revs = [] + for rev in xrange(revsprepull + 1, revspostpull): + revs.append(repo[rev].rev()) + lfcommands.downloadlfiles(ui, repo, revs) return result def overrideclone(orig, ui, source, dest=None, **opts): diff --git a/hgext/largefiles/uisetup.py b/hgext/largefiles/uisetup.py --- a/hgext/largefiles/uisetup.py +++ b/hgext/largefiles/uisetup.py @@ -70,6 +70,9 @@ def uisetup(ui): overrides.overrideupdate) entry = extensions.wrapcommand(commands.table, 'pull', overrides.overridepull) + pullopt = [('', 'all-largefiles', None, + _('download all pulled versions of largefiles'))] + entry[1].extend(pullopt) entry = extensions.wrapcommand(commands.table, 'clone', overrides.overrideclone) cloneopt = [('', 'all-largefiles', None, diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t --- a/tests/test-largefiles.t +++ b/tests/test-largefiles.t @@ -444,6 +444,33 @@ Test cloning with --all-largefiles flag 3 largefiles updated, 0 removed 8 additional largefiles cached +Test pulling with --all-largefiles flag + + $ rm -Rf a-backup + $ hg clone -r 1 a a-backup + adding changesets + adding manifests + adding file changes + added 2 changesets with 8 changes to 4 files + updating to branch default + 4 files updated, 0 files merged, 0 files removed, 0 files unresolved + getting changed largefiles + 2 largefiles updated, 0 removed + $ rm -Rf ${USERCACHE}/* + $ cd a-backup + $ hg pull --all-largefiles + pulling from $TESTTMP/a + searching for changes + adding changesets + adding manifests + adding file changes + added 6 changesets with 16 changes to 8 files + (run 'hg update' to get a working copy) + caching new largefiles + 3 largefiles cached + 3 additional largefiles cached + $ cd .. + Rebasing between two repositories does not revert largefiles to old revisions (this was a very bad bug that took a lot of work to fix).