# HG changeset patch # User mpm@selenic.com # Date 1119684166 28800 # Node ID 157675add351394d47b8132549d7753ebdb2fbd9 # Parent 9d5447a366a70ea308f4cfea9219ba131c7750e2 [PATCH] add "root" command -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [PATCH] add "root" command From: Bryan O'Sullivan Add "root" command Useful for scripting. manifest hash: a2df76139130ac034e53872f24f21f31b083bc42 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCvQZGywK+sNU5EO8RAtYSAKCKRyuxzcDOTV9q+GY5WZDJ/VZgzwCfXhut VvGtiSnIqoBeQ/PtPsokMb0= =gUsq -----END PGP SIGNATURE----- diff -r 9d5447a366a7 -r 157675add351 mercurial/commands.py --- a/mercurial/commands.py Fri Jun 24 23:20:30 2005 -0800 +++ b/mercurial/commands.py Fri Jun 24 23:22:46 2005 -0800 @@ -602,6 +602,10 @@ """remove the specified files on the next commit""" repo.remove(relpath(repo, (file,) + files)) +def root(ui, repo): + """print the root (top) of the current working dir""" + ui.write(repo.root + "\n") + def serve(ui, repo, **opts): """export the repository via HTTP""" hgweb.server(repo.root, opts["name"], opts["templates"], @@ -748,6 +752,7 @@ 'hg rawcommit [options] [files]'), "recover": (recover, [], "hg recover"), "remove|rm": (remove, [], "hg remove [files]"), + "root": (root, [], "hg root"), "serve": (serve, [('p', 'port', 8000, 'listen port'), ('a', 'address', '', 'interface address'), ('n', 'name', os.getcwd(), 'repository name'), diff -r 9d5447a366a7 -r 157675add351 tests/test-help.out --- a/tests/test-help.out Fri Jun 24 23:20:30 2005 -0800 +++ b/tests/test-help.out Fri Jun 24 23:22:46 2005 -0800 @@ -24,6 +24,7 @@ rawcommit raw commit interface recover roll back an interrupted transaction remove remove the specified files on the next commit + root print the root (top) of the current working dir serve export the repository via HTTP status show changed files in the working directory tag add a tag for the current tip or a given revision @@ -74,6 +75,7 @@ rawcommit raw commit interface recover roll back an interrupted transaction remove remove the specified files on the next commit + root print the root (top) of the current working dir serve export the repository via HTTP status show changed files in the working directory tag add a tag for the current tip or a given revision