# HG changeset patch # User Franz Glasner # Date 1510475067 -3600 # Node ID fe48ca312f92f28f3ccafe3330fd37cb075baa1f # Parent 84398f899f8e9bdd176482258c8b703823d360f9 Use "." if the current repository root is to be assumed as path information diff -r 84398f899f8e -r fe48ca312f92 extensions/revinfo.py --- a/extensions/revinfo.py Sun Nov 12 00:53:18 2017 +0100 +++ b/extensions/revinfo.py Sun Nov 12 09:24:27 2017 +0100 @@ -38,16 +38,18 @@ By default, the revision used is the parent of the working directory; use -r/--rev to specify a different revision. - 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. If no path is given then - "default" is assumed. Disable this by providing an empty SOURCE. + Use -p/--path to specify named path information from :hg:`paths` + as the canonical repository location. It will be printed as "path" + item to the output. If no path is given then "default" is + assumed. Use "." to use the current workspace root. + 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. The printed information is the same as the :hg:`archive` command writes into ".hg_archival.txt". The "path" info is an extra item. + """ if opts.get("amend") and opts.get("rev"): raise util.Abort(_("cannot use -r/--rev together with --amend")) @@ -81,12 +83,15 @@ 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 + if canonicalpath == ".": + msg += "path: %s\n" % repo.root else: - msg += "path: %s\n" % 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)