changeset 628:8d7f6e68828a

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.
author Bryan O'Sullivan <bos@serpentine.com>
date Tue, 05 Jul 2005 18:19:22 -0800
parents b6c42714d900
children 2fdf3b1659b9
files mercurial/commands.py
diffstat 1 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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 = ':'