Use repo.getcwd() in a few obvious places.
authorBryan O'Sullivan <bos@serpentine.com>
Tue, 05 Jul 2005 18:19:22 -0800
changeset 628 8d7f6e68828a
parent 627 b6c42714d900
child 629 2fdf3b1659b9
Use repo.getcwd() in a few obvious places. # HG changeset patch # User Bryan O'Sullivan <bos@serpentine.com> # Node ID fb74eaa2b5b763ad5591b2e51dbb377bf8342064 # Parent ebf5eba347a17a5c09000b3342caf350cd060a1b Use repo.getcwd() in a few obvious places.
mercurial/commands.py
--- a/mercurial/commands.py	Tue Jul 05 18:19:01 2005 -0800
+++ b/mercurial/commands.py	Tue Jul 05 18:19:22 2005 -0800
@@ -22,16 +22,15 @@
     return l
 
 def relfilter(repo, files):
-    if os.getcwd() != repo.root:
-        p = os.getcwd()[len(repo.root) + 1: ]
-        return filterfiles([util.pconvert(p)], files)
+    cwd = repo.getcwd()
+    if cwd:
+        return filterfiles([util.pconvert(cwd)], files)
     return files
 
 def relpath(repo, args):
-    if os.getcwd() != repo.root:
-        p = os.getcwd()[len(repo.root) + 1: ]
-        return [ util.pconvert(os.path.normpath(os.path.join(p, x)))
-                 for x in args ]
+    cwd = repo.getcwd()
+    if cwd:
+        return [ util.pconvert(os.path.normpath(os.path.join(cwd, x))) for x in args ]
     return args
 
 revrangesep = ':'