##// END OF EJS Templates
largefiles: allow the archiving of largefiles to be disabled...
Matt Harbison -
r25811:7699d321 default
parent child Browse files
Show More
@@ -878,8 +878,20 b' def overriderebase(orig, ui, repo, **opt'
878 878 repo._lfstatuswriters.pop()
879 879 repo._lfcommithooks.pop()
880 880
881 def overridearchivecmd(orig, ui, repo, dest, **opts):
882 repo.unfiltered().lfstatus = True
883
884 try:
885 return orig(ui, repo.unfiltered(), dest, **opts)
886 finally:
887 repo.unfiltered().lfstatus = False
888
881 889 def overridearchive(orig, repo, dest, node, kind, decode=True, matchfn=None,
882 890 prefix='', mtime=None, subrepos=None):
891 if not repo.lfstatus:
892 return orig(repo, dest, node, kind, decode, matchfn, prefix, mtime,
893 subrepos)
894
883 895 # No need to lock because we are only reading history and
884 896 # largefile caches, neither of which are modified.
885 897 if node is not None:
@@ -943,11 +955,15 b' def overridearchive(orig, repo, dest, no'
943 955 for subpath in sorted(ctx.substate):
944 956 sub = ctx.workingsub(subpath)
945 957 submatch = match_.narrowmatcher(subpath, matchfn)
958 sub._repo.lfstatus = True
946 959 sub.archive(archiver, prefix, submatch)
947 960
948 961 archiver.done()
949 962
950 963 def hgsubrepoarchive(orig, repo, archiver, prefix, match=None):
964 if not repo._repo.lfstatus:
965 return orig(repo, archiver, prefix, match)
966
951 967 repo._get(repo._state + ('hg',))
952 968 rev = repo._state[1]
953 969 ctx = repo._repo[rev]
@@ -996,6 +1012,7 b' def hgsubrepoarchive(orig, repo, archive'
996 1012 for subpath in sorted(ctx.substate):
997 1013 sub = ctx.workingsub(subpath)
998 1014 submatch = match_.narrowmatcher(subpath, match)
1015 sub._repo.lfstatus = True
999 1016 sub.archive(archiver, prefix + repo._path + '/', submatch)
1000 1017
1001 1018 # If a largefile is modified, the change is not reflected in its
@@ -114,6 +114,8 b' def uisetup(ui):'
114 114 entry = extensions.wrapfunction(cmdutil, 'revert',
115 115 overrides.overriderevert)
116 116
117 extensions.wrapcommand(commands.table, 'archive',
118 overrides.overridearchivecmd)
117 119 extensions.wrapfunction(archival, 'archive', overrides.overridearchive)
118 120 extensions.wrapfunction(subrepo.hgsubrepo, 'archive',
119 121 overrides.hgsubrepoarchive)
General Comments 0
You need to be logged in to leave comments. Login now