contrib/hammerclient.py
author Sushil khanchi <sushilkhanchi97@gmail.com>
Fri, 06 Dec 2019 23:43:00 +0530
branchstable
changeset 4992 1eab41625dee
parent 4809 f97379faefa3
permissions -rwxr-xr-x
evolve: abort if deciding resolution parent is ambiguous While solving content-divergence, it could be hard to decide which cset should be treated as a resolution parent if there are multiple successors of divergent cset. i.e split case. But we are planning to make some update in handling this split case: 1) consider highest one if all splitted csets are in a single topological branch 2) still need to decide if 1) doesn't apply

#!/usr/bin/env python
import os
import sys
import subprocess

if len(sys.argv) < 2:
    execname = os.path.basename(sys.argv[0])
    sys.stderr.write("usage: %s CLIENT_ID\n" % execname)

client_id = sys.argv[1]

subprocess.check_call(['hg', 'branch', "--force", "hammer-branch-%s" % client_id])

while True:
    subprocess.check_call([
        'hg', 'commit',
        "--config", "ui.allowemptycommit=yes",
        "--message", "hammer-%s" % client_id,
    ])
    nodeid = subprocess.check_output([
        'hg', 'log', '--rev', '.', '--template', '{node}'
    ])
    subprocess.check_call([
        'hg', 'debugobsolete', ''.join(reversed(nodeid)), nodeid
    ])
    subprocess.check_call(['hg', 'pull'])
    subprocess.check_call(['hg', 'push', '--force'])