Mercurial > evolve
annotate contrib/hammerclient.py @ 6889:a66cf9008781
obslog: also display patch for rebased changesets
This applies the same logic that is used for "merge-diff" to rebased
changesets. The successors' content is compared to the content of the
predecessors rebased in-memory on the new parents.
This highlights the changes that were actually introduced while rebasing (like
conflict resolution or API adjustment).
As a side effect, obslog now also outputs slightly more diffs for splits,
showing what parts of the original big changeset were moved to the smaller
split components (but for now it only works for the first few changesets).
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sun, 22 Sep 2024 02:58:54 +0200 |
parents | f97379faefa3 |
children |
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']) |