Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/hg.py @ 627:b6c42714d900
Add locate command.
# HG changeset patch
# User Bryan O'Sullivan <bos@serpentine.com>
# Node ID ebf5eba347a17a5c09000b3342caf350cd060a1b
# Parent d2994b5298fb20f87dc1d4747635b280db3c0526
Add locate command.
Used for finding files with names that match specific patterns,
such as "*.c".
This patch also introduces localrepository.getcwd, which returns the
current directory relative to the repository root.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Tue, 05 Jul 2005 18:19:01 -0800 |
parents | 876333a295ff |
children | da5378d39269 |
comparison
equal
deleted
inserted
replaced
626:47207ec19c51 | 627:b6c42714d900 |
---|---|
506 | 506 |
507 def file(self, f): | 507 def file(self, f): |
508 if f[0] == '/': f = f[1:] | 508 if f[0] == '/': f = f[1:] |
509 return filelog(self.opener, f) | 509 return filelog(self.opener, f) |
510 | 510 |
511 def getcwd(self): | |
512 cwd = os.getcwd() | |
513 if cwd == self.root: return '' | |
514 return cwd[len(self.root) + 1:] | |
515 | |
511 def wfile(self, f, mode='r'): | 516 def wfile(self, f, mode='r'): |
512 return self.wopener(f, mode) | 517 return self.wopener(f, mode) |
513 | 518 |
514 def transaction(self): | 519 def transaction(self): |
515 # save dirstate for undo | 520 # save dirstate for undo |