mercurial/commands.py
changeset 32649 7a209737f01c
parent 32648 d3d262ff42c0
child 32754 723de0ad3d8b
equal deleted inserted replaced
32648:d3d262ff42c0 32649:7a209737f01c
   375     if skiprevs:
   375     if skiprevs:
   376         skiprevs = scmutil.revrange(repo, skiprevs)
   376         skiprevs = scmutil.revrange(repo, skiprevs)
   377 
   377 
   378     for abs in ctx.walk(m):
   378     for abs in ctx.walk(m):
   379         fctx = ctx[abs]
   379         fctx = ctx[abs]
       
   380         rootfm.startitem()
       
   381         rootfm.data(abspath=abs, path=m.rel(abs))
   380         if not opts.get('text') and fctx.isbinary():
   382         if not opts.get('text') and fctx.isbinary():
   381             rootfm.plain(_("%s: binary file\n")
   383             rootfm.plain(_("%s: binary file\n")
   382                          % ((pats and m.rel(abs)) or abs))
   384                          % ((pats and m.rel(abs)) or abs))
   383             continue
   385             continue
   384 
   386 
   385         fm = rootfm
   387         fm = rootfm.nested('lines')
   386         lines = fctx.annotate(follow=follow, linenumber=linenumber,
   388         lines = fctx.annotate(follow=follow, linenumber=linenumber,
   387                               skiprevs=skiprevs, diffopts=diffopts)
   389                               skiprevs=skiprevs, diffopts=diffopts)
   388         if not lines:
   390         if not lines:
       
   391             fm.end()
   389             continue
   392             continue
   390         formats = []
   393         formats = []
   391         pieces = []
   394         pieces = []
   392 
   395 
   393         for f, sep in funcmap:
   396         for f, sep in funcmap:
   405             fm.write(fields, "".join(f), *p)
   408             fm.write(fields, "".join(f), *p)
   406             fm.write('line', ": %s", l[1])
   409             fm.write('line', ": %s", l[1])
   407 
   410 
   408         if not lines[-1][1].endswith('\n'):
   411         if not lines[-1][1].endswith('\n'):
   409             fm.plain('\n')
   412             fm.plain('\n')
       
   413         fm.end()
   410 
   414 
   411     rootfm.end()
   415     rootfm.end()
   412 
   416 
   413 @command('archive',
   417 @command('archive',
   414     [('', 'no-decode', None, _('do not pass files through decoders')),
   418     [('', 'no-decode', None, _('do not pass files through decoders')),