hgext/largefiles/overrides.py
changeset 17108 1894dac619de
parent 17107 dcac72c9efb2
child 17191 5884812686f7
equal deleted inserted replaced
17107:dcac72c9efb2 17108:1894dac619de
   805         write(f, 'x' in ff and 0755 or 0644, 'l' in ff, getdata)
   805         write(f, 'x' in ff and 0755 or 0644, 'l' in ff, getdata)
   806 
   806 
   807     if subrepos:
   807     if subrepos:
   808         for subpath in ctx.substate:
   808         for subpath in ctx.substate:
   809             sub = ctx.sub(subpath)
   809             sub = ctx.sub(subpath)
   810             sub.archive(repo.ui, archiver, prefix)
   810             submatch = match_.narrowmatcher(subpath, matchfn)
       
   811             sub.archive(repo.ui, archiver, prefix, submatch)
   811 
   812 
   812     archiver.done()
   813     archiver.done()
   813 
   814 
   814 def hgsubrepoarchive(orig, repo, ui, archiver, prefix):
   815 def hgsubrepoarchive(orig, repo, ui, archiver, prefix, match=None):
   815     rev = repo._state[1]
   816     rev = repo._state[1]
   816     ctx = repo._repo[rev]
   817     ctx = repo._repo[rev]
   817 
   818 
   818     lfcommands.cachelfiles(ui, repo._repo, ctx.node())
   819     lfcommands.cachelfiles(ui, repo._repo, ctx.node())
   819 
   820 
   820     def write(name, mode, islink, getdata):
   821     def write(name, mode, islink, getdata):
       
   822         # At this point, the standin has been replaced with the largefile name,
       
   823         # so the normal matcher works here without the lfutil variants.
       
   824         if match and not match(f):
       
   825             return
   821         data = getdata()
   826         data = getdata()
   822 
   827 
   823         archiver.addfile(prefix + repo._path + '/' + name, mode, islink, data)
   828         archiver.addfile(prefix + repo._path + '/' + name, mode, islink, data)
   824 
   829 
   825     for f in ctx:
   830     for f in ctx:
   846 
   851 
   847         write(f, 'x' in ff and 0755 or 0644, 'l' in ff, getdata)
   852         write(f, 'x' in ff and 0755 or 0644, 'l' in ff, getdata)
   848 
   853 
   849     for subpath in ctx.substate:
   854     for subpath in ctx.substate:
   850         sub = ctx.sub(subpath)
   855         sub = ctx.sub(subpath)
   851         sub.archive(ui, archiver, os.path.join(prefix, repo._path) + '/')
   856         submatch = match_.narrowmatcher(subpath, match)
       
   857         sub.archive(ui, archiver, os.path.join(prefix, repo._path) + '/',
       
   858                     submatch)
   852 
   859 
   853 # If a largefile is modified, the change is not reflected in its
   860 # If a largefile is modified, the change is not reflected in its
   854 # standin until a commit. cmdutil.bailifchanged() raises an exception
   861 # standin until a commit. cmdutil.bailifchanged() raises an exception
   855 # if the repo has uncommitted changes. Wrap it to also check if
   862 # if the repo has uncommitted changes. Wrap it to also check if
   856 # largefiles were changed. This is used by bisect and backout.
   863 # largefiles were changed. This is used by bisect and backout.