diff hgext/convert/p4.py @ 37120:a8a902d7176e

procutil: bulk-replace function calls to point to new module
author Yuya Nishihara <yuya@tcha.org>
date Sat, 24 Mar 2018 15:10:51 +0900
parents f0b6fbea00cf
children fc09aafd3c36
line wrap: on
line diff
--- a/hgext/convert/p4.py	Sat Mar 24 15:09:33 2018 +0900
+++ b/hgext/convert/p4.py	Sat Mar 24 15:10:51 2018 +0900
@@ -16,6 +16,7 @@
 )
 from mercurial.utils import (
     dateutil,
+    procutil,
     stringutil,
 )
 
@@ -89,8 +90,8 @@
 
     def _parse_view(self, path):
         "Read changes affecting the path"
-        cmd = 'p4 -G changes -s submitted %s' % util.shellquote(path)
-        stdout = util.popen(cmd, mode='rb')
+        cmd = 'p4 -G changes -s submitted %s' % procutil.shellquote(path)
+        stdout = procutil.popen(cmd, mode='rb')
         p4changes = {}
         for d in loaditer(stdout):
             c = d.get("change", None)
@@ -118,8 +119,8 @@
             else:
                 views = {"//": ""}
         else:
-            cmd = 'p4 -G client -o %s' % util.shellquote(path)
-            clientspec = marshal.load(util.popen(cmd, mode='rb'))
+            cmd = 'p4 -G client -o %s' % procutil.shellquote(path)
+            clientspec = marshal.load(procutil.popen(cmd, mode='rb'))
 
             views = {}
             for client in clientspec:
@@ -198,8 +199,8 @@
                 oldname = depotname[filename]
 
                 flcmd = 'p4 -G filelog %s' \
-                      % util.shellquote(oldname)
-                flstdout = util.popen(flcmd, mode='rb')
+                      % procutil.shellquote(oldname)
+                flstdout = procutil.popen(flcmd, mode='rb')
 
                 copiedfilename = None
                 for d in loaditer(flstdout):
@@ -272,11 +273,11 @@
 
     def getfile(self, name, rev):
         cmd = 'p4 -G print %s' \
-            % util.shellquote("%s#%s" % (self.depotname[name], rev))
+            % procutil.shellquote("%s#%s" % (self.depotname[name], rev))
 
         lasterror = None
         while True:
-            stdout = util.popen(cmd, mode='rb')
+            stdout = procutil.popen(cmd, mode='rb')
 
             mode = None
             contents = []
@@ -358,7 +359,7 @@
         """Return an output of `p4 describe` including author, commit date as
         a dictionary."""
         cmd = "p4 -G describe -s %s" % rev
-        stdout = util.popen(cmd, mode='rb')
+        stdout = procutil.popen(cmd, mode='rb')
         return marshal.load(stdout)
 
     def getcommit(self, rev):