changeset 5233:9d7052f17d77

convert: fix /dev/null redirections under Windows
author Patrick Mezard <pmezard@gmail.com>
date Sun, 26 Aug 2007 19:05:19 +0200
parents ceb6f242fb81
children 20770c5d41e0 8ede77c2d008
files hgext/convert/git.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/git.py
+++ b/hgext/convert/git.py
@@ -1,6 +1,7 @@
 # git support for the convert extension
 
 import os
+from mercurial import util
 
 from common import NoRepo, commit, converter_source
 
@@ -46,7 +47,8 @@ class convert_git(converter_source):
 
     def catfile(self, rev, type):
         if rev == "0" * 40: raise IOError()
-        fh = self.gitcmd("git-cat-file %s %s 2>/dev/null" % (type, rev))
+        fh = self.gitcmd("git-cat-file %s %s 2>%s" % (type, rev,
+                                                      util.nulldev))
         return fh.read()
 
     def getfile(self, name, rev):
@@ -105,7 +107,8 @@ class convert_git(converter_source):
 
     def gettags(self):
         tags = {}
-        fh = self.gitcmd('git-ls-remote --tags "%s" 2>/dev/null' % self.path)
+        fh = self.gitcmd('git-ls-remote --tags "%s" 2>%s' % (self.path,
+                                                             util.nulldev))
         prefix = 'refs/tags/'
         for line in fh:
             line = line.strip()