Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 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 | a58af3932cee |
comparison
equal
deleted
inserted
replaced
627:b6c42714d900 | 628:8d7f6e68828a |
---|---|
20 if t and t[-1] != "/": t += "/" | 20 if t and t[-1] != "/": t += "/" |
21 l += [ x for x in files if x.startswith(t) ] | 21 l += [ x for x in files if x.startswith(t) ] |
22 return l | 22 return l |
23 | 23 |
24 def relfilter(repo, files): | 24 def relfilter(repo, files): |
25 if os.getcwd() != repo.root: | 25 cwd = repo.getcwd() |
26 p = os.getcwd()[len(repo.root) + 1: ] | 26 if cwd: |
27 return filterfiles([util.pconvert(p)], files) | 27 return filterfiles([util.pconvert(cwd)], files) |
28 return files | 28 return files |
29 | 29 |
30 def relpath(repo, args): | 30 def relpath(repo, args): |
31 if os.getcwd() != repo.root: | 31 cwd = repo.getcwd() |
32 p = os.getcwd()[len(repo.root) + 1: ] | 32 if cwd: |
33 return [ util.pconvert(os.path.normpath(os.path.join(p, x))) | 33 return [ util.pconvert(os.path.normpath(os.path.join(cwd, x))) for x in args ] |
34 for x in args ] | |
35 return args | 34 return args |
36 | 35 |
37 revrangesep = ':' | 36 revrangesep = ':' |
38 | 37 |
39 def revrange(ui, repo, revs = [], revlog = None): | 38 def revrange(ui, repo, revs = [], revlog = None): |