hg cat: relative file support
authormpm@selenic.com
Wed, 08 Jun 2005 10:59:18 -0800
changeset 281 574420507d8c
parent 280 a69c3b2957d1
child 282 97d83e7fbf2f
hg cat: relative file support -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 hg cat: relative file support also fix a bug in relpath From: K Thananchayan <thananck@yahoo.com> manifest hash: a443a66dfb90b38ea491de1e817b2877170bc9f8 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCp0AGywK+sNU5EO8RAgfVAJ9vlXfLKs1A/TegG3wuPeuxoSQMCACbBPGF RObiYj1st0k1zQYBlvSlQbk= =GZbB -----END PGP SIGNATURE-----
mercurial/commands.py
--- a/mercurial/commands.py	Wed Jun 08 10:52:01 2005 -0800
+++ b/mercurial/commands.py	Wed Jun 08 10:59:18 2005 -0800
@@ -23,7 +23,7 @@
 def relfilter(repo, files):
     if os.getcwd() != repo.root:
         p = os.getcwd()[len(repo.root) + 1: ]
-        return filterfiles(p, files)
+        return filterfiles([p], files)
     return files
 
 def relpath(repo, args):
@@ -160,7 +160,7 @@
 
 def cat(ui, repo, file, rev = []):
     """output the latest or given revision of a file"""
-    r = repo.file(file)
+    r = repo.file(relpath(repo, [file])[0])
     n = r.tip()
     if rev: n = r.lookup(rev)
     sys.stdout.write(r.read(n))