# HG changeset patch # User Franz Glasner # Date 1444633012 -7200 # Node ID 8ca89d70b44cc7013bcd4b2f0a156406a667d284 # Parent 5ac4608c51096be88ce6538f7739625c4f4ad424 Make the "-p/--path" option an option that can be repeated. The behaviour is fully backward compatible. diff -r 5ac4608c5109 -r 8ca89d70b44c extensions/revinfo.py --- a/extensions/revinfo.py Sun Sep 27 15:15:11 2015 +0200 +++ b/extensions/revinfo.py Mon Oct 12 08:56:52 2015 +0200 @@ -21,7 +21,7 @@ @command("revinfo", [("r", "rev", "", _('revision to handle'), _('REV')), ("", "amend", None, _('amend a given file with path information')), - ("p", "path", "default", _('the configured default path'), _('SOURCE')), + ("p", "path", [], _('the configured default path'), _('SOURCE')), ], _("hg revinfo [OPTION]... [DEST]")) def revinfo(ui, repo, dest=None, **opts): @@ -35,8 +35,8 @@ Use -p/--path to specify the named path information from :hg:`paths` as the canonical repository location. It will be - printed as "path" item to the output. Disable this by providing - an empty SOURCE. + printed as "path" item to the output. If no path is given then + "default" is assumed. Disable this by providing an empty SOURCE. Use --amend to extend a given file with a "path" item. Can also be used to put more than one path item into the file. @@ -58,14 +58,17 @@ raise util.Abort(_("no working directory: please specify a revision")) msg = archival.buildmetadata(ctx) - canonicalpath = opts.get("path") - if canonicalpath: - for name, path in sorted(ui.paths.iteritems()): - if name == canonicalpath: - msg += "path: %s\n" % util.hidepassword(path.loc) - break - else: - msg += "path: %s\n" % canonicalpath + paths = opts.get("path") + if not paths: + paths = ["default"] + for canonicalpath in paths: + if canonicalpath: + for name, path in sorted(ui.paths.iteritems()): + if name == canonicalpath: + msg += "path: %s\n" % util.hidepassword(path.loc) + break + else: + msg += "path: %s\n" % canonicalpath if dest: with open(dest, "wb") as rfile: rfile.write(msg)