changeset 4:8884ce4b78d4

Use correct directory for export command.
author Sjoerd Mullender <sjoerd@acm.org>
date Tue, 14 May 2013 12:29:18 +0200 (2013-05-14)
parents 561cb4f73b83
children 32c51a111990
files check_whitespace.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/check_whitespace.py	Mon May 13 22:19:14 2013 +0200
+++ b/check_whitespace.py	Tue May 14 12:29:18 2013 +0200
@@ -68,7 +68,11 @@
     import os, sys, subprocess
 
     added = 0
-    for filename, linenum, msg in trailing_whitespace(subprocess.Popen(['hg', 'export', 'tip'], stdout=subprocess.PIPE).stdout):
+    cmd = ['hg', 'export']
+    if repo:
+        cmd.extend(['--cwd', repo.root])
+    cmd.append('tip')
+    for filename, linenum, msg in trailing_whitespace(subprocess.Popen(cmd, stdout=subprocess.PIPE).stdout):
         print >> sys.stderr, ('%s, line %d: %s added' %
                               (filename, linenum, msg))
         added += 1