Normalized paths before use in rel_filename
authorAaron Bentley <abentley@panoramicfeedback.com>
Wed, 18 May 2005 18:37:17 +0000 (18:37 +0000)
committerAaron Bentley <abentley@panoramicfeedback.com>
Wed, 18 May 2005 18:37:17 +0000 (18:37 +0000)
becommands/set_root.py
libbe/arch.py

index ad20b8ee0ecd7b8c2633c3bcd2ed542e81709f39..14286e0e2c114581b5035ce07ee6a5e8e6786348 100644 (file)
@@ -20,6 +20,7 @@ from libbe import bugdir, cmdutil, rcs
 def execute(args):
     """
     >>> from libbe import tests
+    >>> import os
     >>> dir = tests.Dir()
     >>> try:
     ...     bugdir.tree_root(dir.name)
@@ -32,7 +33,8 @@ def execute(args):
     >>> bd = bugdir.tree_root(dir.name)
     >>> bd.root = dir.name
     >>> dir = tests.arch_dir()
-    >>> execute([dir.name])
+    >>> os.chdir(dir.name)
+    >>> execute('.')
     Using Arch for revision control.
     Directory initialized.
     >>> bd = bugdir.tree_root(dir.name+"/{arch}")
index 55daed0a9eb6e7a8a00251b0c38f895b4ed59ac4..e2d867f47a434dfca836a9f59bce4ab979ffd8b8 100644 (file)
@@ -74,6 +74,8 @@ def tree_root(filename):
     return invoke_client("tree-root", dirname).rstrip('\n')
 
 def rel_filename(filename, root):
+    filename = os.path.realpath(filename)
+    root = os.path.realpath(root)
     assert(filename.startswith(root))
     return filename[len(root)+1:]