Mercurial > public > mercurial-scm > hg-stable
diff hgext/largefiles/overrides.py @ 18978:8abaadab9abb
largefiles: introduce pull --lfrev option
The revset will be evaluated after the changesets has been pulled, and missing
largefiles from matching revisions will be pulled to the local caches.
This in combination with revsets will make it possible to specify different
strategies for pulling largefiles.
The revset expressions used for this option might be quite complex and will
probably be most useful from scripts or an alias ... but less complicated than
configuring hooks.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Mon, 15 Apr 2013 01:57:16 +0200 |
parents | 864232481e76 |
children | 1176832fc757 |
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py Mon Apr 15 01:54:43 2013 +0200 +++ b/hgext/largefiles/overrides.py Mon Apr 15 01:57:16 2013 +0200 @@ -753,6 +753,14 @@ for rev in xrange(revsprepull, revspostpull): revs.append(repo[rev].rev()) lfcommands.downloadlfiles(ui, repo, revs) + lfrevs = opts.get('lfrev', []) + if lfrevs and revspostpull > revsprepull: + numcached = 0 + for rev in scmutil.revrange(repo, lfrevs): + ui.note(_('pulling largefiles for revision %s\n') % rev) + (cached, missing) = lfcommands.cachelfiles(ui, repo, rev) + numcached += len(cached) + ui.status(_("%d largefiles cached\n") % numcached) return result def overrideclone(orig, ui, source, dest=None, **opts):