changeset 1504:0fcdd126642d

fix file opening for some commands on Windows Using file as opener in debug commands won't work on Windows, as the index and data files needs to be opened in binary mode.
author Christian Boos <cboos@neuf.fr>
date Thu, 03 Nov 2005 14:24:07 -0800
parents d176c81481c8
children 27f08094cfe0
files mercurial/commands.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Thu Nov 03 14:22:19 2005 -0800
+++ b/mercurial/commands.py	Thu Nov 03 14:24:07 2005 -0800
@@ -896,7 +896,7 @@
 
 def debugancestor(ui, index, rev1, rev2):
     """find the ancestor revision of two revisions in a given index"""
-    r = revlog.revlog(file, index, "")
+    r = revlog.revlog(util.opener(os.getcwd()), index, "")
     a = r.ancestor(r.lookup(rev1), r.lookup(rev2))
     ui.write("%d:%s\n" % (r.rev(a), hex(a)))
 
@@ -969,7 +969,7 @@
 
 def debugdata(ui, file_, rev):
     """dump the contents of an data file revision"""
-    r = revlog.revlog(file, file_[:-2] + ".i", file_)
+    r = revlog.revlog(util.opener(os.getcwd()), file_[:-2] + ".i", file_)
     try:
         ui.write(r.revision(r.lookup(rev)))
     except KeyError:
@@ -977,7 +977,7 @@
 
 def debugindex(ui, file_):
     """dump the contents of an index file"""
-    r = revlog.revlog(file, file_, "")
+    r = revlog.revlog(util.opener(os.getcwd()), file_, "")
     ui.write("   rev    offset  length   base linkrev" +
              " nodeid       p1           p2\n")
     for i in range(r.count()):
@@ -988,7 +988,7 @@
 
 def debugindexdot(ui, file_):
     """dump an index DAG as a .dot file"""
-    r = revlog.revlog(file, file_, "")
+    r = revlog.revlog(util.opener(os.getcwd()), file_, "")
     ui.write("digraph G {\n")
     for i in range(r.count()):
         e = r.index[i]