Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 468:157675add351
[PATCH] add "root" command
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
[PATCH] add "root" command
From: Bryan O'Sullivan <bos@serpentine.com>
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-----
author | mpm@selenic.com |
---|---|
date | Fri, 24 Jun 2005 23:22:46 -0800 |
parents | 9d5447a366a7 |
children | 0ab093b473c5 |
line wrap: on
line diff
--- 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'),