[PATCH 3 of 3 hg-2.5] scmutil: localize and improve 'not under root' message

Mads Kiilerich mads at kiilerich.com
Fri Jan 18 18:18:33 CST 2013


# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1358468669 -3600
# Node ID 1687ce05bb5059dc0fdf4d1d0cb5ba91c18a85a6
# Parent  fa3d243c80436334fc3a2e230b37ceaf42c53007
scmutil: localize and improve 'not under root' message

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -435,7 +435,7 @@
                 break
             name = dirname
 
-        raise util.Abort('%s not under root' % myname)
+        raise util.Abort(_("%s not under root '%s'") % (myname, root))
 
 def walkrepos(path, followsym=False, seen_dirs=None, recurse=False):
     '''yield every hg repository under path, always recursively.
diff --git a/tests/test-globalopts.t b/tests/test-globalopts.t
--- a/tests/test-globalopts.t
+++ b/tests/test-globalopts.t
@@ -87,7 +87,7 @@
   abort: no repository found in '$TESTTMP' (.hg not found)!
   [255]
   $ hg -R b ann a/a
-  abort: a/a not under root
+  abort: a/a not under root '$TESTTMP/b'
   [255]
   $ hg log
   abort: no repository found in '$TESTTMP' (.hg not found)!
diff --git a/tests/test-parents.t b/tests/test-parents.t
--- a/tests/test-parents.t
+++ b/tests/test-parents.t
@@ -71,7 +71,7 @@
   
 
   $ hg parents -r 2 ../a
-  abort: ../a not under root
+  abort: ../a not under root '$TESTTMP/repo'
   [255]
 
 
diff --git a/tests/test-rename.t b/tests/test-rename.t
--- a/tests/test-rename.t
+++ b/tests/test-rename.t
@@ -593,7 +593,7 @@
   [255]
   $ hg status -C
   $ hg rename d1/d11/a1 ../foo
-  abort: ../foo not under root
+  abort: ../foo not under root '$TESTTMP'
   [255]
   $ hg status -C
 
@@ -612,7 +612,7 @@
   [255]
   $ hg status -C
   $ hg rename d1/d11/a1 ..
-  abort: ../a1 not under root (glob)
+  abort: ../a1 not under root '$TESTTMP'
   [255]
   $ hg status -C
 
@@ -631,7 +631,7 @@
   [255]
   $ hg status -C
   $ (cd d1/d11; hg rename ../../d2/b ../../../foo)
-  abort: ../../../foo not under root
+  abort: ../../../foo not under root '$TESTTMP'
   [255]
   $ hg status -C
 
diff --git a/tests/test-symlinks.t b/tests/test-symlinks.t
--- a/tests/test-symlinks.t
+++ b/tests/test-symlinks.t
@@ -82,7 +82,7 @@
 this should fail
 
   $ hg status ../z && { echo hg mistakenly exited with status 0; exit 1; } || :
-  abort: ../z not under root
+  abort: ../z not under root '$TESTTMP/x'
   $ cd ..
 
 
diff --git a/tests/test-walk.t b/tests/test-walk.t
--- a/tests/test-walk.t
+++ b/tests/test-walk.t
@@ -181,10 +181,10 @@
   f  mammals/Procyonidae/raccoon     mammals/Procyonidae/raccoon
   f  mammals/skunk                   mammals/skunk
   $ hg debugwalk ..
-  abort: .. not under root
+  abort: .. not under root '$TESTTMP/t'
   [255]
   $ hg debugwalk beans/../..
-  abort: beans/../.. not under root
+  abort: beans/../.. not under root '$TESTTMP/t'
   [255]
   $ hg debugwalk .hg
   abort: path contains illegal component: .hg (glob)
@@ -209,7 +209,7 @@
   f  beans/pinto     beans/pinto
   f  beans/turtle    beans/turtle
   $ hg debugwalk `pwd`/..
-  abort: $TESTTMP/t/.. not under root
+  abort: $TESTTMP/t/.. not under root '$TESTTMP/t'
   [255]
 
 Test patterns:


More information about the Mercurial-devel mailing list