contrib/hammerclient.py
author Sushil khanchi <sushilkhanchi97@gmail.com>
Fri, 22 Feb 2019 01:02:51 +0530
changeset 4416 b2a8e67b0933
parent 4003 518e04284921
child 4809 f97379faefa3
permissions -rwxr-xr-x
evolve: handle a case in pubic-div when merging results in same as public In public divergence resolution, what we do is: 1) first apply content divergence resolution 2) then phase divergent resolution on resultant node of 1) case While doing case 1 it is possible that result of merging the two csets would have same changes as public one contains. And then processing the case 2 would create an empty commit which is not something we want to do. So this patch catch that same case when merging results in same as public cset and don't create a new node, instead to solve the divergence it just add a obsmarker from "other divergent" to "public divergent" i.e. [other, (public,)] Next patch will add the continue case handling for this same case. This patch also adds the tests for the different cases which are possible for the above mentioned case. There is test for continue case too which is broken in this patch and will be fixed in next patch.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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])
518e04284921 contrib: introduce a small script to stress tests obsolescence exchange
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     8
    print >> sys.stderr, "usage: %s CLIENT_ID" % execname
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'])