1. fudanchii
  2. hgapi

Commits

fudanchii  committed 1c68060

Remove build_cmd

  • Participants
  • Parent commits ca0818a
  • Branches default

Comments (0)

Files changed (1)

File hgapi/hgapi.py

View file
 except:
     import simplejson as json
 
-
-def build_cmd(cmdlist, to_str=False):
-    if to_str:
-        return " ".join(cmdlist)
-    return cmdlist
-
 class Revision(object):
     """A representation of a revision.
     Available fields are::
     def hg_command(self, *args):
         """Run a hg command in path and return the result.
         Throws on error."""
-        cmds = build_cmd(["hg", "--cwd", self.path, "--encoding", "UTF-8"] + list(args))
-        proc = Popen(cmds, stdout=PIPE, stderr=PIPE)
+        proc = Popen(["hg", "--cwd", self.path, "--encoding", "UTF-8"] + list(args), stdout=PIPE, stderr=PIPE)
 
         out, err = [x.decode("utf-8") for x in  proc.communicate()]
 
         if proc.returncode:
-            cmd = (" ".join(cmds))
+            cmd = (" ".join(["hg", "--cwd", self.path] + list(args)))
             raise Exception("Error running %s:\n\tErr: %s\n\tOut: %s\n\tExit: %s" 
                             % (cmd,err,out,proc.returncode))
         return out