tests/test-resolve.t
changeset 44396 acbfa31cfaf2
parent 42804 7b80ad5af239
child 44856 b7808443ed6a
--- a/tests/test-resolve.t	Thu Feb 13 21:55:38 2020 -0800
+++ b/tests/test-resolve.t	Thu Feb 13 21:14:20 2020 -0800
@@ -306,48 +306,40 @@
 
   $ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -x
   $ hg debugmergestate
-  * version 2 records
-  local: 57653b9f834a4493f7240b0681efcb9ae7cab745
-  other: dc77451844e37f03f5c559e3b8529b2b48d381d1
-  labels:
-    local: working copy
-    other: merge rev
-  unrecognized entry: x	advisory record
-  file extras: file1 (ancestorlinknode = 99726c03216e233810a2564cbc0adfe395007eac)
-  file: file1 (record type "F", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
-    local path: file1 (flags "")
+  local (working copy): 57653b9f834a4493f7240b0681efcb9ae7cab745
+  other (merge rev): dc77451844e37f03f5c559e3b8529b2b48d381d1
+  file: file1 (state "r")
+    local path: file1 (hash 60b27f004e454aca81b0480209cce5081ec52390, flags "")
     ancestor path: file1 (node 2ed2a3912a0b24502043eae84ee4b279c18b90dd)
     other path: file1 (node 6f4310b00b9a147241b071a60c28a650827fb03d)
-  file extras: file2 (ancestorlinknode = 99726c03216e233810a2564cbc0adfe395007eac)
-  file: file2 (record type "F", state "u", hash cb99b709a1978bd205ab9dfd4c5aaa1fc91c7523)
-    local path: file2 (flags "")
+    extra: ancestorlinknode = 99726c03216e233810a2564cbc0adfe395007eac
+  file: file2 (state "u")
+    local path: file2 (hash cb99b709a1978bd205ab9dfd4c5aaa1fc91c7523, flags "")
     ancestor path: file2 (node 2ed2a3912a0b24502043eae84ee4b279c18b90dd)
     other path: file2 (node 6f4310b00b9a147241b071a60c28a650827fb03d)
+    extra: ancestorlinknode = 99726c03216e233810a2564cbc0adfe395007eac
   $ hg resolve -l
   R file1
   U file2
 
+test json output
+
+  $ hg debugmergestate -T json
+  [
+   {
+    "commits": [{"label": "working copy", "name": "local", "node": "57653b9f834a4493f7240b0681efcb9ae7cab745"}, {"label": "merge rev", "name": "other", "node": "dc77451844e37f03f5c559e3b8529b2b48d381d1"}],
+    "files": [{"ancestor_node": "2ed2a3912a0b24502043eae84ee4b279c18b90dd", "ancestor_path": "file1", "extras": [{"key": "ancestorlinknode", "value": "99726c03216e233810a2564cbc0adfe395007eac"}], "local_flags": "", "local_key": "60b27f004e454aca81b0480209cce5081ec52390", "local_path": "file1", "other_node": "6f4310b00b9a147241b071a60c28a650827fb03d", "other_path": "file1", "path": "file1", "state": "r"}, {"ancestor_node": "2ed2a3912a0b24502043eae84ee4b279c18b90dd", "ancestor_path": "file2", "extras": [{"key": "ancestorlinknode", "value": "99726c03216e233810a2564cbc0adfe395007eac"}], "local_flags": "", "local_key": "cb99b709a1978bd205ab9dfd4c5aaa1fc91c7523", "local_path": "file2", "other_node": "6f4310b00b9a147241b071a60c28a650827fb03d", "other_path": "file2", "path": "file2", "state": "u"}]
+   }
+  ]
+
+
 insert unsupported mandatory merge record
 
   $ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -X
   $ hg debugmergestate
-  * version 2 records
-  local: 57653b9f834a4493f7240b0681efcb9ae7cab745
-  other: dc77451844e37f03f5c559e3b8529b2b48d381d1
-  labels:
-    local: working copy
-    other: merge rev
-  file extras: file1 (ancestorlinknode = 99726c03216e233810a2564cbc0adfe395007eac)
-  file: file1 (record type "F", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
-    local path: file1 (flags "")
-    ancestor path: file1 (node 2ed2a3912a0b24502043eae84ee4b279c18b90dd)
-    other path: file1 (node 6f4310b00b9a147241b071a60c28a650827fb03d)
-  file extras: file2 (ancestorlinknode = 99726c03216e233810a2564cbc0adfe395007eac)
-  file: file2 (record type "F", state "u", hash cb99b709a1978bd205ab9dfd4c5aaa1fc91c7523)
-    local path: file2 (flags "")
-    ancestor path: file2 (node 2ed2a3912a0b24502043eae84ee4b279c18b90dd)
-    other path: file2 (node 6f4310b00b9a147241b071a60c28a650827fb03d)
-  unrecognized entry: X	mandatory record
+  abort: unsupported merge state records: X
+  (see https://mercurial-scm.org/wiki/MergeStateRecords for more information)
+  [255]
   $ hg resolve -l
   abort: unsupported merge state records: X
   (see https://mercurial-scm.org/wiki/MergeStateRecords for more information)