# HG changeset patch # User Bryan O'Sullivan # Date 1120616362 28800 # Node ID 8d7f6e68828ae4511c8045bccdda0d86d664d4e7 # Parent b6c42714d900453ed698bf365d264de02e031ff6 Use repo.getcwd() in a few obvious places. # HG changeset patch # User Bryan O'Sullivan # Node ID fb74eaa2b5b763ad5591b2e51dbb377bf8342064 # Parent ebf5eba347a17a5c09000b3342caf350cd060a1b Use repo.getcwd() in a few obvious places. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -22,16 +22,15 @@ def filterfiles(filters, files): 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 = ':'