##// END OF EJS Templates
manifest: add formatter support
Matt Mackall -
r17911:8a8d1a2f default
parent child Browse files
Show More
@@ -4206,6 +4206,9 b' def manifest(ui, repo, node=None, rev=No'
4206
4206
4207 Returns 0 on success.
4207 Returns 0 on success.
4208 """
4208 """
4209
4210 fm = ui.formatter('manifest', opts)
4211
4209 if opts.get('all'):
4212 if opts.get('all'):
4210 if rev or node:
4213 if rev or node:
4211 raise util.Abort(_("can't specify a revision with --all"))
4214 raise util.Abort(_("can't specify a revision with --all"))
@@ -4223,7 +4226,9 b' def manifest(ui, repo, node=None, rev=No'
4223 finally:
4226 finally:
4224 lock.release()
4227 lock.release()
4225 for f in res:
4228 for f in res:
4226 ui.write("%s\n" % f)
4229 fm.startitem()
4230 fm.write("path", '%s\n', f)
4231 fm.end()
4227 return
4232 return
4228
4233
4229 if rev and node:
4234 if rev and node:
@@ -4232,14 +4237,17 b' def manifest(ui, repo, node=None, rev=No'
4232 if not node:
4237 if not node:
4233 node = rev
4238 node = rev
4234
4239
4235 decor = {'l':'644 @ ', 'x':'755 * ', '':'644 '}
4240 char = {'l': '@', 'x': '*', '': ''}
4241 mode = {'l': '644', 'x': '755', '': '644'}
4236 ctx = scmutil.revsingle(repo, node)
4242 ctx = scmutil.revsingle(repo, node)
4243 mf = ctx.manifest()
4237 for f in ctx:
4244 for f in ctx:
4238 if ui.debugflag:
4245 fm.startitem()
4239 ui.write("%40s " % hex(ctx.manifest()[f]))
4246 fl = ctx[f].flags()
4240 if ui.verbose:
4247 fm.condwrite(ui.debugflag, 'hash', '%s ', hex(mf[f]))
4241 ui.write(decor[ctx.flags(f)])
4248 fm.condwrite(ui.verbose, 'mode type', '%s %1s ', mode[fl], char[fl])
4242 ui.write("%s\n" % f)
4249 fm.write('path', '%s\n', f)
4250 fm.end()
4243
4251
4244 @command('^merge',
4252 @command('^merge',
4245 [('f', 'force', None, _('force a merge with outstanding changes')),
4253 [('f', 'force', None, _('force a merge with outstanding changes')),
General Comments 0
You need to be logged in to leave comments. Login now