Skip to content
Browse files

silence confusing output from `hg update null`

  • Loading branch information...
1 parent 23eaa53 commit 89b119e713a0182dc6956716fabde8ff497341ff @rfk committed
Showing with 8 additions and 2 deletions.
  1. +4 −0 ChangeLog.txt
  2. +4 −2 git_remote_hg/__init__.py
View
4 ChangeLog.txt
@@ -1,4 +1,8 @@
+v0.1.1:
+
+ * trim down output for some hg commands, to reduce noise and confusion.
+
v0.1.0:
* initial release - you might say *everything* has changed...
View
6 git_remote_hg/__init__.py
@@ -171,12 +171,14 @@ def __init__(self, git_dir, hg_url):
def _do(self, *cmd, **kwds):
"""Run a hg command, capturing and reporting output."""
+ silent = kwds.pop("silent", False)
kwds["stdout"] = subprocess.PIPE
kwds["stderr"] = subprocess.STDOUT
p = subprocess.Popen(cmd, **kwds)
output = p.stdout.readline()
while output:
- print>>sys.stderr, "hg :: " + output.strip()
+ if not silent:
+ print>>sys.stderr, "hg :: " + output.strip()
output = p.stdout.readline()
p.wait()
@@ -198,7 +200,7 @@ def initialize_hg_repo(self):
if not os.path.isdir(os.path.dirname(hg_repo_dir)):
os.makedirs(os.path.dirname(hg_repo_dir))
self._do("hg", "clone", self.hg_url, hg_repo_dir)
- self._do("hg", "update", "null", cwd=hg_repo_dir)
+ self._do("hg", "update", "null", cwd=hg_repo_dir, silent=True)
with open(os.path.join(hg_repo_dir, "README.txt"), "wt") as f:
f.write(dedent("""
This is a bare mercurial checkout created by git-remote-hg.

0 comments on commit 89b119e

Please sign in to comment.
Something went wrong with that request. Please try again.