mercurial/commands.py
changeset 38358 57dc72b56b6c
parent 38357 31ed65f9c5ad
child 38361 2ceea1554d1e
equal deleted inserted replaced
38357:31ed65f9c5ad 38358:57dc72b56b6c
   357         def makefunc(get, fmt):
   357         def makefunc(get, fmt):
   358             return lambda x: fmt(get(x))
   358             return lambda x: fmt(get(x))
   359     else:
   359     else:
   360         def makefunc(get, fmt):
   360         def makefunc(get, fmt):
   361             return get
   361             return get
       
   362     datahint = rootfm.datahint()
   362     funcmap = [(makefunc(get, fmt), sep) for fn, sep, get, fmt in opmap
   363     funcmap = [(makefunc(get, fmt), sep) for fn, sep, get, fmt in opmap
   363                if opts.get(opnamemap.get(fn, fn))]
   364                if opts.get(opnamemap.get(fn, fn)) or fn in datahint]
   364     funcmap[0] = (funcmap[0][0], '') # no separator in front of first column
   365     funcmap[0] = (funcmap[0][0], '') # no separator in front of first column
   365     fields = ' '.join(fn for fn, sep, get, fmt in opmap
   366     fields = ' '.join(fn for fn, sep, get, fmt in opmap
   366                       if opts.get(opnamemap.get(fn, fn)))
   367                       if opts.get(opnamemap.get(fn, fn)) or fn in datahint)
   367 
   368 
   368     def bad(x, y):
   369     def bad(x, y):
   369         raise error.Abort("%s: %s" % (x, y))
   370         raise error.Abort("%s: %s" % (x, y))
   370 
   371 
   371     m = scmutil.match(ctx, pats, opts, badfn=bad)
   372     m = scmutil.match(ctx, pats, opts, badfn=bad)