mercurial/rewriteutil.py
author Matt Harbison <matt_harbison@yahoo.com>
Mon, 24 Aug 2020 18:44:15 -0400
changeset 45425 f7e293e0475f
parent 45424 0a57ef4b3bdb
child 45427 78861610ded8
permissions -rw-r--r--
rewriteutil: also consider pending obsoletes when updating hashes in messages Phabricator builds up the replacement commits and mapping in a single transaction, and then finalizes everything once the commits have been rewritten. That's too late when trying to update the messages for those commits. I'm a little concerned that this isn't a generic enough interface, since it doesn't mimic the list of list return of `obsutil.successorssets()`. But this is the type of mapping that phabricator maintains, and I don't think the methods that would be interested in calling this need to worry about split and divergence. We can fix that later if the need arises. Differential Revision: https://phab.mercurial-scm.org/D8949
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35242
27d5c2d2db2b rewriteutil: add utility function to check if we can create new unstable cset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     1
# rewriteutil.py - utility functions for rewriting changesets
27d5c2d2db2b rewriteutil: add utility function to check if we can create new unstable cset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     2
#
27d5c2d2db2b rewriteutil: add utility function to check if we can create new unstable cset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     3
# Copyright 2017 Octobus <contact@octobus.net>
27d5c2d2db2b rewriteutil: add utility function to check if we can create new unstable cset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     4
#
27d5c2d2db2b rewriteutil: add utility function to check if we can create new unstable cset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     5
# This software may be used and distributed according to the terms of the
27d5c2d2db2b rewriteutil: add utility function to check if we can create new unstable cset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     6
# GNU General Public License version 2 or any later version.
27d5c2d2db2b rewriteutil: add utility function to check if we can create new unstable cset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     7
27d5c2d2db2b rewriteutil: add utility function to check if we can create new unstable cset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     8
from __future__ import absolute_import
27d5c2d2db2b rewriteutil: add utility function to check if we can create new unstable cset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     9
45424
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
    10
import re
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
    11
35243
490df753894d rewriteutil: add a precheck function to check if revs can be rewritten
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35242
diff changeset
    12
from .i18n import _
490df753894d rewriteutil: add a precheck function to check if revs can be rewritten
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35242
diff changeset
    13
35242
27d5c2d2db2b rewriteutil: add utility function to check if we can create new unstable cset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    14
from . import (
35243
490df753894d rewriteutil: add a precheck function to check if revs can be rewritten
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35242
diff changeset
    15
    error,
490df753894d rewriteutil: add a precheck function to check if revs can be rewritten
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35242
diff changeset
    16
    node,
35242
27d5c2d2db2b rewriteutil: add utility function to check if we can create new unstable cset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    17
    obsolete,
45424
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
    18
    obsutil,
35242
27d5c2d2db2b rewriteutil: add utility function to check if we can create new unstable cset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    19
    revset,
45424
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
    20
    scmutil,
35242
27d5c2d2db2b rewriteutil: add utility function to check if we can create new unstable cset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    21
)
27d5c2d2db2b rewriteutil: add utility function to check if we can create new unstable cset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    22
43075
57875cf423c9 style: run a patched black on a subset of mercurial
Augie Fackler <augie@google.com>
parents: 40636
diff changeset
    23
45424
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
    24
sha1re = re.compile(br'\b[0-9a-f]{6,40}\b')
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
    25
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
    26
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43075
diff changeset
    27
def precheck(repo, revs, action=b'rewrite'):
35243
490df753894d rewriteutil: add a precheck function to check if revs can be rewritten
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35242
diff changeset
    28
    """check if revs can be rewritten
490df753894d rewriteutil: add a precheck function to check if revs can be rewritten
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35242
diff changeset
    29
    action is used to control the error message.
490df753894d rewriteutil: add a precheck function to check if revs can be rewritten
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35242
diff changeset
    30
490df753894d rewriteutil: add a precheck function to check if revs can be rewritten
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35242
diff changeset
    31
    Make sure this function is called after taking the lock.
490df753894d rewriteutil: add a precheck function to check if revs can be rewritten
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35242
diff changeset
    32
    """
490df753894d rewriteutil: add a precheck function to check if revs can be rewritten
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35242
diff changeset
    33
    if node.nullrev in revs:
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43075
diff changeset
    34
        msg = _(b"cannot %s null changeset") % action
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43075
diff changeset
    35
        hint = _(b"no changeset checked out")
35243
490df753894d rewriteutil: add a precheck function to check if revs can be rewritten
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35242
diff changeset
    36
        raise error.Abort(msg, hint=hint)
490df753894d rewriteutil: add a precheck function to check if revs can be rewritten
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35242
diff changeset
    37
490df753894d rewriteutil: add a precheck function to check if revs can be rewritten
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35242
diff changeset
    38
    if len(repo[None].parents()) > 1:
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43075
diff changeset
    39
        raise error.Abort(_(b"cannot %s while merging") % action)
35243
490df753894d rewriteutil: add a precheck function to check if revs can be rewritten
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35242
diff changeset
    40
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43075
diff changeset
    41
    publicrevs = repo.revs(b'%ld and public()', revs)
35243
490df753894d rewriteutil: add a precheck function to check if revs can be rewritten
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35242
diff changeset
    42
    if publicrevs:
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43075
diff changeset
    43
        msg = _(b"cannot %s public changesets") % action
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43075
diff changeset
    44
        hint = _(b"see 'hg help phases' for details")
35243
490df753894d rewriteutil: add a precheck function to check if revs can be rewritten
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35242
diff changeset
    45
        raise error.Abort(msg, hint=hint)
490df753894d rewriteutil: add a precheck function to check if revs can be rewritten
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35242
diff changeset
    46
490df753894d rewriteutil: add a precheck function to check if revs can be rewritten
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35242
diff changeset
    47
    newunstable = disallowednewunstable(repo, revs)
490df753894d rewriteutil: add a precheck function to check if revs can be rewritten
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35242
diff changeset
    48
    if newunstable:
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43075
diff changeset
    49
        raise error.Abort(_(b"cannot %s changeset with children") % action)
35243
490df753894d rewriteutil: add a precheck function to check if revs can be rewritten
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35242
diff changeset
    50
43075
57875cf423c9 style: run a patched black on a subset of mercurial
Augie Fackler <augie@google.com>
parents: 40636
diff changeset
    51
35242
27d5c2d2db2b rewriteutil: add utility function to check if we can create new unstable cset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    52
def disallowednewunstable(repo, revs):
27d5c2d2db2b rewriteutil: add utility function to check if we can create new unstable cset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    53
    """Checks whether editing the revs will create new unstable changesets and
27d5c2d2db2b rewriteutil: add utility function to check if we can create new unstable cset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    54
    are we allowed to create them.
27d5c2d2db2b rewriteutil: add utility function to check if we can create new unstable cset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    55
27d5c2d2db2b rewriteutil: add utility function to check if we can create new unstable cset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    56
    To allow new unstable changesets, set the config:
27d5c2d2db2b rewriteutil: add utility function to check if we can create new unstable cset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    57
        `experimental.evolution.allowunstable=True`
27d5c2d2db2b rewriteutil: add utility function to check if we can create new unstable cset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    58
    """
27d5c2d2db2b rewriteutil: add utility function to check if we can create new unstable cset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    59
    allowunstable = obsolete.isenabled(repo, obsolete.allowunstableopt)
27d5c2d2db2b rewriteutil: add utility function to check if we can create new unstable cset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    60
    if allowunstable:
27d5c2d2db2b rewriteutil: add utility function to check if we can create new unstable cset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    61
        return revset.baseset()
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43075
diff changeset
    62
    return repo.revs(b"(%ld::) - %ld", revs, revs)
45122
a391d0710f22 rewriteutil: add utility to check whether empty successors should be skipped
Manuel Jacob <me@manueljacob.de>
parents: 43077
diff changeset
    63
a391d0710f22 rewriteutil: add utility to check whether empty successors should be skipped
Manuel Jacob <me@manueljacob.de>
parents: 43077
diff changeset
    64
a391d0710f22 rewriteutil: add utility to check whether empty successors should be skipped
Manuel Jacob <me@manueljacob.de>
parents: 43077
diff changeset
    65
def skip_empty_successor(ui, command):
a391d0710f22 rewriteutil: add utility to check whether empty successors should be skipped
Manuel Jacob <me@manueljacob.de>
parents: 43077
diff changeset
    66
    empty_successor = ui.config(b'rewrite', b'empty-successor')
a391d0710f22 rewriteutil: add utility to check whether empty successors should be skipped
Manuel Jacob <me@manueljacob.de>
parents: 43077
diff changeset
    67
    if empty_successor == b'skip':
a391d0710f22 rewriteutil: add utility to check whether empty successors should be skipped
Manuel Jacob <me@manueljacob.de>
parents: 43077
diff changeset
    68
        return True
a391d0710f22 rewriteutil: add utility to check whether empty successors should be skipped
Manuel Jacob <me@manueljacob.de>
parents: 43077
diff changeset
    69
    elif empty_successor == b'keep':
a391d0710f22 rewriteutil: add utility to check whether empty successors should be skipped
Manuel Jacob <me@manueljacob.de>
parents: 43077
diff changeset
    70
        return False
a391d0710f22 rewriteutil: add utility to check whether empty successors should be skipped
Manuel Jacob <me@manueljacob.de>
parents: 43077
diff changeset
    71
    else:
a391d0710f22 rewriteutil: add utility to check whether empty successors should be skipped
Manuel Jacob <me@manueljacob.de>
parents: 43077
diff changeset
    72
        raise error.ConfigError(
a391d0710f22 rewriteutil: add utility to check whether empty successors should be skipped
Manuel Jacob <me@manueljacob.de>
parents: 43077
diff changeset
    73
            _(
a391d0710f22 rewriteutil: add utility to check whether empty successors should be skipped
Manuel Jacob <me@manueljacob.de>
parents: 43077
diff changeset
    74
                b"%s doesn't know how to handle config "
a391d0710f22 rewriteutil: add utility to check whether empty successors should be skipped
Manuel Jacob <me@manueljacob.de>
parents: 43077
diff changeset
    75
                b"rewrite.empty-successor=%s (only 'skip' and 'keep' are "
a391d0710f22 rewriteutil: add utility to check whether empty successors should be skipped
Manuel Jacob <me@manueljacob.de>
parents: 43077
diff changeset
    76
                b"supported)"
a391d0710f22 rewriteutil: add utility to check whether empty successors should be skipped
Manuel Jacob <me@manueljacob.de>
parents: 43077
diff changeset
    77
            )
a391d0710f22 rewriteutil: add utility to check whether empty successors should be skipped
Manuel Jacob <me@manueljacob.de>
parents: 43077
diff changeset
    78
            % (command, empty_successor)
a391d0710f22 rewriteutil: add utility to check whether empty successors should be skipped
Manuel Jacob <me@manueljacob.de>
parents: 43077
diff changeset
    79
        )
45424
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
    80
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
    81
45425
f7e293e0475f rewriteutil: also consider pending obsoletes when updating hashes in messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 45424
diff changeset
    82
def update_hash_refs(repo, commitmsg, pending=None):
45424
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
    83
    """Replace all obsolete commit hashes in the message with the current hash.
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
    84
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
    85
    If the obsolete commit was split or is divergent, the hash is not replaced
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
    86
    as there's no way to know which successor to choose.
45425
f7e293e0475f rewriteutil: also consider pending obsoletes when updating hashes in messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 45424
diff changeset
    87
f7e293e0475f rewriteutil: also consider pending obsoletes when updating hashes in messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 45424
diff changeset
    88
    For commands that update a series of commits in the current transaction, the
f7e293e0475f rewriteutil: also consider pending obsoletes when updating hashes in messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 45424
diff changeset
    89
    new obsolete markers can be considered by setting ``pending`` to a mapping
f7e293e0475f rewriteutil: also consider pending obsoletes when updating hashes in messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 45424
diff changeset
    90
    of ``pending[oldnode] = [successor_node1, successor_node2,..]``.
45424
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
    91
    """
45425
f7e293e0475f rewriteutil: also consider pending obsoletes when updating hashes in messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 45424
diff changeset
    92
    if not pending:
f7e293e0475f rewriteutil: also consider pending obsoletes when updating hashes in messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 45424
diff changeset
    93
        pending = {}
45424
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
    94
    cache = {}
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
    95
    sha1s = re.findall(sha1re, commitmsg)
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
    96
    unfi = repo.unfiltered()
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
    97
    for sha1 in sha1s:
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
    98
        fullnode = scmutil.resolvehexnodeidprefix(unfi, sha1)
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
    99
        if fullnode is None:
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
   100
            continue
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
   101
        ctx = unfi[fullnode]
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
   102
        if not ctx.obsolete():
45425
f7e293e0475f rewriteutil: also consider pending obsoletes when updating hashes in messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 45424
diff changeset
   103
            successors = pending.get(fullnode)
f7e293e0475f rewriteutil: also consider pending obsoletes when updating hashes in messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 45424
diff changeset
   104
            if successors is None:
f7e293e0475f rewriteutil: also consider pending obsoletes when updating hashes in messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 45424
diff changeset
   105
                continue
f7e293e0475f rewriteutil: also consider pending obsoletes when updating hashes in messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 45424
diff changeset
   106
            # obsutil.successorssets() returns a list of list of nodes
f7e293e0475f rewriteutil: also consider pending obsoletes when updating hashes in messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 45424
diff changeset
   107
            successors = [successors]
f7e293e0475f rewriteutil: also consider pending obsoletes when updating hashes in messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 45424
diff changeset
   108
        else:
f7e293e0475f rewriteutil: also consider pending obsoletes when updating hashes in messages
Matt Harbison <matt_harbison@yahoo.com>
parents: 45424
diff changeset
   109
            successors = obsutil.successorssets(repo, ctx.node(), cache=cache)
45424
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
   110
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
   111
        # We can't make any assumptions about how to update the hash if the
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
   112
        # cset in question was split or diverged.
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
   113
        if len(successors) == 1 and len(successors[0]) == 1:
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
   114
            newsha1 = node.hex(successors[0][0])
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
   115
            commitmsg = commitmsg.replace(sha1, newsha1[: len(sha1)])
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
   116
        else:
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
   117
            repo.ui.note(
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
   118
                _(
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
   119
                    b'The stale commit message reference to %s could '
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
   120
                    b'not be updated\n'
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
   121
                )
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
   122
                % sha1
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
   123
            )
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
   124
0a57ef4b3bdb rewriteutil: extract evolve code used to replace obsolete hashes in commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45122
diff changeset
   125
    return commitmsg