##// END OF EJS Templates
largefiles: use common function to build content of .hg_archival.txt...
Yuya Nishihara -
r24680:0974d3a0 default
parent child Browse files
Show More
@@ -14,7 +14,6 b' import copy'
14 14 from mercurial import hg, util, cmdutil, scmutil, match as match_, \
15 15 archival, pathutil, revset
16 16 from mercurial.i18n import _
17 from mercurial.node import hex
18 17
19 18 import lfutil
20 19 import lfcommands
@@ -900,24 +899,8 b' def overridearchive(orig, repo, dest, no'
900 899 archiver = archival.archivers[kind](dest, mtime or ctx.date()[0])
901 900
902 901 if repo.ui.configbool("ui", "archivemeta", True):
903 def metadata():
904 base = 'repo: %s\nnode: %s\nbranch: %s\n' % (
905 hex(repo.changelog.node(0)), hex(node), ctx.branch())
906
907 tags = ''.join('tag: %s\n' % t for t in ctx.tags()
908 if repo.tagtype(t) == 'global')
909 if not tags:
910 repo.ui.pushbuffer()
911 opts = {'template': '{latesttag}\n{latesttagdistance}',
912 'style': '', 'patch': None, 'git': None}
913 cmdutil.show_changeset(repo.ui, repo, opts).show(ctx)
914 ltags, dist = repo.ui.popbuffer().split('\n')
915 tags = ''.join('latesttag: %s\n' % t for t in ltags.split(':'))
916 tags += 'latesttagdistance: %s\n' % dist
917
918 return base + tags
919
920 write('.hg_archival.txt', 0644, False, metadata)
902 write('.hg_archival.txt', 0644, False,
903 lambda: archival.buildmetadata(ctx))
921 904
922 905 for f in ctx:
923 906 ff = ctx.flags(f)
@@ -342,6 +342,7 b' Lock in subrepo, otherwise the change is'
342 342 branch: default
343 343 latesttag: null
344 344 latesttagdistance: 4
345 changessincelatesttag: 4
345 346
346 347 Test update with subrepos.
347 348
General Comments 0
You need to be logged in to leave comments. Login now