From 53f5cced06f25dc49cedf1a3fb181201b727a521 Mon Sep 17 00:00:00 2001 From: Aaron Bentley Date: Wed, 18 May 2005 18:37:17 +0000 Subject: [PATCH] Normalized paths before use in rel_filename --- becommands/set_root.py | 4 +++- libbe/arch.py | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/becommands/set_root.py b/becommands/set_root.py index ad20b8e..14286e0 100644 --- a/becommands/set_root.py +++ b/becommands/set_root.py @@ -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}") diff --git a/libbe/arch.py b/libbe/arch.py index 55daed0..e2d867f 100644 --- a/libbe/arch.py +++ b/libbe/arch.py @@ -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:] -- 2.26.2