Patchwork [hglib] summary: parse commit line less strictly (issue5637)

login
register
mail settings
Submitter Yuya Nishihara
Date Aug. 2, 2017, 2:52 p.m.
Message ID <5f3e6f1a7e68298e21f8.1501685559@mimosa>
Download mbox | patch
Permalink /patch/22641/
State Accepted
Headers show

Comments

Yuya Nishihara - Aug. 2, 2017, 2:52 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1501684996 -32400
#      Wed Aug 02 23:43:16 2017 +0900
# Node ID 5f3e6f1a7e68298e21f893683c5b5d3f634c2c30
# Parent  8e959ad6a25c9fe6ab490e1a4cbd5f7445d9bcb1
summary: parse commit line less strictly (issue5637)
Augie Fackler - Aug. 28, 2017, 6:29 p.m.
On Wed, Aug 02, 2017 at 11:52:39PM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1501684996 -32400
> #      Wed Aug 02 23:43:16 2017 +0900
> # Node ID 5f3e6f1a7e68298e21f893683c5b5d3f634c2c30
> # Parent  8e959ad6a25c9fe6ab490e1a4cbd5f7445d9bcb1
> summary: parse commit line less strictly (issue5637)

queued, thanks

Patch

diff --git a/hglib/client.py b/hglib/client.py
--- a/hglib/client.py
+++ b/hglib/client.py
@@ -1597,7 +1597,7 @@  class hgclient(object):
             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
diff --git a/tests/test-summary.py b/tests/test-summary.py
--- a/tests/test-summary.py
+++ b/tests/test-summary.py
@@ -1,3 +1,4 @@ 
+import unittest
 from tests import common
 import hglib
 from hglib.util import b
@@ -38,6 +39,15 @@  class test_summary(common.basetest):
 
         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)