hgext/largefiles/overrides.py
changeset 18704 d69585a5c5c0
parent 18610 46edbc49a9f2
child 18731 c2d079387b2c
equal deleted inserted replaced
18700:4a85ebb5c807 18704:d69585a5c5c0
   731         if not source:
   731         if not source:
   732             source = 'default'
   732             source = 'default'
   733         repo.lfpullsource = source
   733         repo.lfpullsource = source
   734         oldheads = lfutil.getcurrentheads(repo)
   734         oldheads = lfutil.getcurrentheads(repo)
   735         result = orig(ui, repo, source, **opts)
   735         result = orig(ui, repo, source, **opts)
   736         # If we do not have the new largefiles for any new heads we pulled, we
   736         if opts.get('cache_largefiles'):
   737         # will run into a problem later if we try to merge or rebase with one of
   737             # If you are pulling from a remote location that is not your
   738         # these heads, so cache the largefiles now directly into the system
   738             # default location, you may want to cache largefiles for new heads
   739         # cache.
   739             # that have been pulled, so you can easily merge or rebase with
   740         numcached = 0
   740             # them later
   741         heads = lfutil.getcurrentheads(repo)
   741             numcached = 0
   742         newheads = set(heads).difference(set(oldheads))
   742             heads = lfutil.getcurrentheads(repo)
   743         if len(newheads) > 0:
   743             newheads = set(heads).difference(set(oldheads))
   744             ui.status(_("caching largefiles for %s heads\n") % len(newheads))
   744             if len(newheads) > 0:
   745         for head in newheads:
   745                 ui.status(_("caching largefiles for %s heads\n") %
   746             (cached, missing) = lfcommands.cachelfiles(ui, repo, head)
   746                           len(newheads))
   747             numcached += len(cached)
   747             for head in newheads:
   748         ui.status(_("%d largefiles cached\n") % numcached)
   748                 (cached, missing) = lfcommands.cachelfiles(ui, repo, head)
       
   749                 numcached += len(cached)
       
   750             ui.status(_("%d largefiles cached\n") % numcached)
   749     if opts.get('all_largefiles'):
   751     if opts.get('all_largefiles'):
   750         revspostpull = len(repo)
   752         revspostpull = len(repo)
   751         revs = []
   753         revs = []
   752         for rev in xrange(revsprepull + 1, revspostpull):
   754         for rev in xrange(revsprepull + 1, revspostpull):
   753             revs.append(repo[rev].rev())
   755             revs.append(repo[rev].rev())