annotate contrib/hammerclient.py @ 4991:2928f35023a1 stable

evolve: make sure divergence resolution doesn't undo changes (issue6203) Before this patch, in content-divergence resolution logic if resolution parent is not the parent of any of the two divergent changesets then it could undo some changes introduced by previous revs (while resolving stack of content-divergent changesets) as demonstrated by the test added in previous patch. To solve this, what this patch doing is: if divergent cset has obsolete parent with a successor then first resolve the "orphan" instability of divergent cset by relocating, then perform the content-divergence resolution. After this change in logic, I found that it's kind of more correct as reflected by the changes in tests/test-evolve-content-divergent-corner-cases.t where it prevented creating conflicts while merging. Changes in tests/test-evolve-content-divergent-stack.t demonstrate the fixed behaviour. Next patches will be covering the `evolve --continue` case for the relocation of "divergent" cset.
author Sushil khanchi <sushilkhanchi97@gmail.com>
date Sat, 23 Nov 2019 16:17:04 +0530
parents f97379faefa3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4003
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
1 #!/usr/bin/env python
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
2 import os
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
3 import sys
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
4 import subprocess
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
5
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
6 if len(sys.argv) < 2:
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
7 execname = os.path.basename(sys.argv[0])
4809
f97379faefa3 flake8: silence F633 error
Raphaël Gomès <rgomes@octobus.net>
parents: 4003
diff changeset
8 sys.stderr.write("usage: %s CLIENT_ID\n" % execname)
4003
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
9
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
10 client_id = sys.argv[1]
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
11
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
12 subprocess.check_call(['hg', 'branch', "--force", "hammer-branch-%s" % client_id])
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
13
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
14 while True:
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
15 subprocess.check_call([
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
16 'hg', 'commit',
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
17 "--config", "ui.allowemptycommit=yes",
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
18 "--message", "hammer-%s" % client_id,
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
19 ])
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
20 nodeid = subprocess.check_output([
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
21 'hg', 'log', '--rev', '.', '--template', '{node}'
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
22 ])
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
23 subprocess.check_call([
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
24 'hg', 'debugobsolete', ''.join(reversed(nodeid)), nodeid
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
25 ])
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
26 subprocess.check_call(['hg', 'pull'])
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
27 subprocess.check_call(['hg', 'push', '--force'])