Commits

Germán Poo-Caamaño committed 10ad9bb

nautilus: fix error when there is no repo in the current directory

Comments (0)

Files changed (1)

contrib/nautilus-thg.py

         repo = self.get_repo_for_path(path)
         cwd = os.path.isdir(path) and path or os.path.dirname(path)
 
+        if repo is not 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]