##// 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 repo._lfstatuswriters.pop()
878 repo._lfstatuswriters.pop()
879 repo._lfcommithooks.pop()
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 def overridearchive(orig, repo, dest, node, kind, decode=True, matchfn=None,
889 def overridearchive(orig, repo, dest, node, kind, decode=True, matchfn=None,
882 prefix='', mtime=None, subrepos=None):
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 # No need to lock because we are only reading history and
895 # No need to lock because we are only reading history and
884 # largefile caches, neither of which are modified.
896 # largefile caches, neither of which are modified.
885 if node is not None:
897 if node is not None:
@@ -943,11 +955,15 b' def overridearchive(orig, repo, dest, no'
943 for subpath in sorted(ctx.substate):
955 for subpath in sorted(ctx.substate):
944 sub = ctx.workingsub(subpath)
956 sub = ctx.workingsub(subpath)
945 submatch = match_.narrowmatcher(subpath, matchfn)
957 submatch = match_.narrowmatcher(subpath, matchfn)
958 sub._repo.lfstatus = True
946 sub.archive(archiver, prefix, submatch)
959 sub.archive(archiver, prefix, submatch)
947
960
948 archiver.done()
961 archiver.done()
949
962
950 def hgsubrepoarchive(orig, repo, archiver, prefix, match=None):
963 def hgsubrepoarchive(orig, repo, archiver, prefix, match=None):
964 if not repo._repo.lfstatus:
965 return orig(repo, archiver, prefix, match)
966
951 repo._get(repo._state + ('hg',))
967 repo._get(repo._state + ('hg',))
952 rev = repo._state[1]
968 rev = repo._state[1]
953 ctx = repo._repo[rev]
969 ctx = repo._repo[rev]
@@ -996,6 +1012,7 b' def hgsubrepoarchive(orig, repo, archive'
996 for subpath in sorted(ctx.substate):
1012 for subpath in sorted(ctx.substate):
997 sub = ctx.workingsub(subpath)
1013 sub = ctx.workingsub(subpath)
998 submatch = match_.narrowmatcher(subpath, match)
1014 submatch = match_.narrowmatcher(subpath, match)
1015 sub._repo.lfstatus = True
999 sub.archive(archiver, prefix + repo._path + '/', submatch)
1016 sub.archive(archiver, prefix + repo._path + '/', submatch)
1000
1017
1001 # If a largefile is modified, the change is not reflected in its
1018 # If a largefile is modified, the change is not reflected in its
@@ -114,6 +114,8 b' def uisetup(ui):'
114 entry = extensions.wrapfunction(cmdutil, 'revert',
114 entry = extensions.wrapfunction(cmdutil, 'revert',
115 overrides.overriderevert)
115 overrides.overriderevert)
116
116
117 extensions.wrapcommand(commands.table, 'archive',
118 overrides.overridearchivecmd)
117 extensions.wrapfunction(archival, 'archive', overrides.overridearchive)
119 extensions.wrapfunction(archival, 'archive', overrides.overridearchive)
118 extensions.wrapfunction(subrepo.hgsubrepo, 'archive',
120 extensions.wrapfunction(subrepo.hgsubrepo, 'archive',
119 overrides.hgsubrepoarchive)
121 overrides.hgsubrepoarchive)
General Comments 0
You need to be logged in to leave comments. Login now