changeset 6969:d76f64cd4cb2

graphlog: fix calls from outside the repository (issue1285)
author Patrick Mezard <pmezard@gmail.com>
date Tue, 02 Sep 2008 09:25:29 +0200
parents 381a892159d9
children f7f0388f7bce 9fc5bf4adbcf
files hgext/graphlog.py tests/test-glog tests/test-glog.out
diffstat 3 files changed, 23 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/graphlog.py	Sun Aug 31 11:36:07 2008 +0200
+++ b/hgext/graphlog.py	Tue Sep 02 09:25:29 2008 +0200
@@ -216,8 +216,9 @@
         return
     cs_printer = show_changeset(ui, repo, opts)
     if path:
-        cpath = canonpath(repo.root, os.getcwd(), path)
-        grapher = filelog_grapher(repo, cpath, start_rev, stop_rev)
+        path = canonpath(repo.root, os.getcwd(), path)
+    if path:
+        grapher = filelog_grapher(repo, path, start_rev, stop_rev)
     else:
         grapher = revision_grapher(repo, start_rev, stop_rev)
     repo_parents = repo.dirstate.parents()
--- a/tests/test-glog	Sun Aug 31 11:36:07 2008 +0200
+++ b/tests/test-glog	Tue Sep 02 09:25:29 2008 +0200
@@ -144,3 +144,10 @@
 
 echo % unused arguments
 hg glog -q foo bar || echo failed
+
+echo % from outer space
+cd ..
+hg glog -l1 repo
+hg glog -l1 repo/0
+hg glog -l1 repo/missing
+
--- a/tests/test-glog.out	Sun Aug 31 11:36:07 2008 +0200
+++ b/tests/test-glog.out	Tue Sep 02 09:25:29 2008 +0200
@@ -356,3 +356,16 @@
 
 show revision history alongside an ASCII revision graph
 failed
+% from outer space
+@  changeset:   34:0eed7cd895e0
+|  tag:         tip
+|  parent:      32:77f7d8438a3c
+|  user:        test
+|  date:        Thu Jan 01 00:00:34 1970 +0000
+|  summary:     (34) head
+|
+o  changeset:   0:7aa22e58e8c1
+   user:        test
+   date:        Thu Jan 01 00:00:00 1970 +0000
+   summary:     (0) root
+