# HG changeset patch # User Germán Póo-Caamaño # Date 1216561232 14400 # Node ID 1c95c2301e5feb1857078044c2d668a73a438162 # Parent 15415a973353234c079a9b7031430faf30b377f5 nautilus: fix actions when the menu is invoked outside a repository diff -r 15415a973353 -r 1c95c2301e5f contrib/nautilus-thg.py --- a/contrib/nautilus-thg.py Sun Jul 20 09:33:06 2008 -0400 +++ b/contrib/nautilus-thg.py Sun Jul 20 09:40:32 2008 -0400 @@ -168,8 +168,13 @@ repo = self.get_repo_for_path(path) cwd = os.path.isdir(path) and path or os.path.dirname(path) + if repo is None: + root = repo.root + else: + root = cwd + cmdopts = [sys.executable, self.hgproc] - cmdopts += ['--root', repo.root] + cmdopts += ['--root', root] cmdopts += ['--cwd', cwd] cmdopts += ['--command', hgcmd]