Mercurial > evolve
changeset 3562:fe16284cd95a
evolve: include "operation" metadata in obsmarkers
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Mon, 12 Mar 2018 15:40:28 -0700 |
parents | 4701e8888c4f |
children | d4c457c1ae0d |
files | hgext3rd/evolve/evolvecmd.py tests/test-split.t tests/test-stabilize-order.t tests/test-stabilize-result.t |
diffstat | 4 files changed, 15 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext3rd/evolve/evolvecmd.py Mon Mar 12 15:50:25 2018 -0700 +++ b/hgext3rd/evolve/evolvecmd.py Mon Mar 12 15:40:28 2018 -0700 @@ -235,7 +235,8 @@ tmpid = relocate(repo, bumped, prec.p1()) if tmpid is not None: tmpctx = repo[tmpid] - compat.createmarkers(repo, [(bumped, (tmpctx,))]) + compat.createmarkers(repo, [(bumped, (tmpctx,))], + operation='evolve') except MergeFailure: repo.vfs.write('graftstate', bumped.hex() + '\n') repo.ui.write_err(_('evolution failed!\n')) @@ -280,12 +281,12 @@ newid = repo.commitctx(new) if newid is None: - compat.createmarkers(repo, [(tmpctx, ())]) + compat.createmarkers(repo, [(tmpctx, ())], operation='evolve') newid = prec.node() else: phases.retractboundary(repo, tr, bumped.phase(), [newid]) compat.createmarkers(repo, [(tmpctx, (repo[newid],))], - flag=obsolete.bumpedfix) + flag=obsolete.bumpedfix, operation='evolve') bmupdate(newid) repo.ui.status(_('committed as %s\n') % node.short(newid)) # reroute the working copy parent to the new changeset @@ -408,7 +409,7 @@ # no changes else: new = repo['.'] - compat.createmarkers(repo, [(other, (new,))]) + compat.createmarkers(repo, [(other, (new,))], operation='evolve') phases.retractboundary(repo, tr, other.phase(), [new.node()]) return (True, new.node()) finally: @@ -546,11 +547,12 @@ bmchanges = [] if nodenew is not None: - compat.createmarkers(repo, [(repo[nodesrc], (repo[nodenew],))]) + compat.createmarkers(repo, [(repo[nodesrc], (repo[nodenew],))], + operation='evolve') for book in oldbookmarks: bmchanges.append((book, nodenew)) else: - compat.createmarkers(repo, [(repo[nodesrc], ())]) + compat.createmarkers(repo, [(repo[nodesrc], ())], operation='evolve') # Behave like rebase, move bookmarks to dest for book in oldbookmarks: bmchanges.append((book, dest.node())) @@ -1221,10 +1223,8 @@ # resolving conflicts can lead to empty wdir and node can be None in # those cases - if node is not None: - compat.createmarkers(repo, [(ctx, (repo[node],))]) - else: - compat.createmarkers(repo, [(ctx, (repo['.'],))]) + newctx = repo[node] if node is not None else repo['.'] + compat.createmarkers(repo, [(ctx, (newctx,))], operation='evolve') # make sure we are continuing evolve and not `hg next --evolve` if evolvestate['command'] == 'evolve':
--- a/tests/test-split.t Mon Mar 12 15:50:25 2018 -0700 +++ b/tests/test-split.t Mon Mar 12 15:40:28 2018 -0700 @@ -212,8 +212,8 @@ 1334a80b33c3f9873edab728fbbcf500eab61d2e d2fe56e71366c2c5376c89960c281395062c0619 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'} d2fe56e71366c2c5376c89960c281395062c0619 2d8abdb827cdf71ca477ef6985d7ceb257c53c1b 033b3f5ae73db67c10de938fb6f26b949aaef172 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'user': 'test'} 52149352b372d39b19127d5bd2d488b1b63f9f85 b434287e665ce757ee5463a965cb3d119ca9e893 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'} - 2d8abdb827cdf71ca477ef6985d7ceb257c53c1b e2b4afde39803bd42bb1374b230fca1b1e8cc868 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'user': 'test'} - 033b3f5ae73db67c10de938fb6f26b949aaef172 bb5e4f6020c74e7961a51fda635ea9df9b04dda8 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'user': 'test'} + 2d8abdb827cdf71ca477ef6985d7ceb257c53c1b e2b4afde39803bd42bb1374b230fca1b1e8cc868 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'} + 033b3f5ae73db67c10de938fb6f26b949aaef172 bb5e4f6020c74e7961a51fda635ea9df9b04dda8 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'} b434287e665ce757ee5463a965cb3d119ca9e893 ead2066d1dbf14833fe1069df1b735e4e9468c40 1188c4216eba37f18a1de6558564601d00ff2143 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'user': 'test'} $ hg evolve --all move:[8] split1
--- a/tests/test-stabilize-order.t Mon Mar 12 15:50:25 2018 -0700 +++ b/tests/test-stabilize-order.t Mon Mar 12 15:40:28 2018 -0700 @@ -112,8 +112,8 @@ @@ -1,3 +1,4 @@ ef23d6ef94d68dea65d20587dfecc8b33d165617 22619daeed78036f80fbd326b6852519c4f0c25e 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'} 93418d2c0979643ad446f621195e78720edb05b4 005fe5914f78e8bc64c7eba28117b0b1fa210d0d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'} - 22619daeed78036f80fbd326b6852519c4f0c25e 81b8bbcd5892841efed41433d7a5e9df922396cb 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'user': 'test'} - +7a7552255fb5f8bd745e46fba6f0ca633a4dd716 0f691739f91762462bf8ba21f35fdf71fe64310e 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'user': 'test'} + 22619daeed78036f80fbd326b6852519c4f0c25e 81b8bbcd5892841efed41433d7a5e9df922396cb 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'} + +7a7552255fb5f8bd745e46fba6f0ca633a4dd716 0f691739f91762462bf8ba21f35fdf71fe64310e 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'} [1]
--- a/tests/test-stabilize-result.t Mon Mar 12 15:50:25 2018 -0700 +++ b/tests/test-stabilize-result.t Mon Mar 12 15:40:28 2018 -0700 @@ -51,7 +51,7 @@ $ hg debugobsolete 102a90ea7b4a3361e4082ed620918c261189a36a fb9d051ec0a450a4aa2ffc8c324979832ef88065 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'} - cce2c55b896511e0b6e04173c9450ba822ebc740 0 {102a90ea7b4a3361e4082ed620918c261189a36a} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'user': 'test'} + cce2c55b896511e0b6e04173c9450ba822ebc740 0 {102a90ea7b4a3361e4082ed620918c261189a36a} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'} Test evolve with conflict