changeset 187:9062a6b935ad

summary: parse commit line less strictly (issue5637)
author Yuya Nishihara <yuya@tcha.org>
date Wed, 02 Aug 2017 23:43:16 +0900
parents d06b48001662
children 5609a21fe39a
files hglib/client.py tests/test-summary.py
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hglib/client.py	Wed Jul 19 14:48:40 2017 +0200
+++ b/hglib/client.py	Wed Aug 02 23:43:16 2017 +0900
@@ -1597,7 +1597,7 @@
             elif name == b('branch'):
                 pass
             elif name == b('commit'):
-                value = value == b('(clean)')
+                value = b('(clean)') in value
             elif name == b('update'):
                 if value == b('(current)'):
                     value = 0
--- a/tests/test-summary.py	Wed Jul 19 14:48:40 2017 +0200
+++ b/tests/test-summary.py	Wed Aug 02 23:43:16 2017 +0900
@@ -1,3 +1,4 @@
+import unittest
 from tests import common
 import hglib
 from hglib.util import b
@@ -38,6 +39,15 @@
 
         self.assertEquals(self.client.summary(), d)
 
+    def test_secret_commit_clean(self):
+        if self.client.version < (2, 1):
+            raise unittest.SkipTest('phase not supported')
+        self.append('a', 'a')
+        rev, node = self.client.commit(b('first'), addremove=True)
+        self.client.phase([b('%d') % rev], secret=True, force=True)
+        e = self.client.summary()
+        self.assertTrue(e[b('commit')])
+
     def test_update(self):
         self.append('a', 'a')
         rev, node = self.client.commit(b('first'), addremove=True)