[PATCH] client: always set HGPLAIN=1 (issue3502)

Siddharth Agarwal sid0 at fb.com
Mon Oct 15 11:46:06 CDT 2012


# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1350319543 25200
# Node ID 86ff8611a8fad14d4c1dba6d75bc26caaa41e951
# Parent  6e423f7c784fc41e22d1fd4fa68680801f83cbd7
client: always set HGPLAIN=1 (issue3502)

Not setting it breaks output parsing on some commands.

diff -r 6e423f7c784f -r 86ff8611a8fa hglib/client.py
--- a/hglib/client.py	Thu Mar 01 23:16:07 2012 -0500
+++ b/hglib/client.py	Mon Oct 15 09:45:43 2012 -0700
@@ -48,7 +48,7 @@
             self._args += ['-R', path]
         if configs:
             self._args += ['--config'] + configs
-        self._env = {}
+        self._env = {'HGPLAIN': '1'}
         if encoding:
             self._env['HGENCODING'] = encoding
 
diff -r 6e423f7c784f -r 86ff8611a8fa tests/test-diff.py
--- a/tests/test-diff.py	Thu Mar 01 23:16:07 2012 -0500
+++ b/tests/test-diff.py	Mon Oct 15 09:45:43 2012 -0700
@@ -38,3 +38,7 @@
 +a
 """ % (node0[:12], node1[:12])
         self.assertEquals(diff4, self.client.diff(revs=[rev0, rev1], nodates=True))
+
+    def test_basic_plain(self):
+        open('.hg/hgrc', 'a').write('[defaults]\ndiff=--git\n')
+        self.test_basic()
diff -r 6e423f7c784f -r 86ff8611a8fa tests/test-update.py
--- a/tests/test-update.py	Thu Mar 01 23:16:07 2012 -0500
+++ b/tests/test-update.py	Mon Oct 15 09:45:43 2012 -0700
@@ -66,3 +66,7 @@
         u, m, r, ur = self.client.update(clean=True)
         self.assertEquals(u, 1)
         self.assertEquals(old, open('a').read())
+
+    def test_basic_plain(self):
+        open('.hg/hgrc', 'a').write('[defaults]\nupdate=-v\n')
+        self.test_basic()


More information about the Mercurial-devel mailing list