Show More
@@ -21,7 +21,7 b' from . import (' | |||
|
21 | 21 | ) |
|
22 | 22 | |
|
23 | 23 | |
|
24 |
|
|
|
24 | NODE_RE = re.compile(br'\b[0-9a-f]{6,64}\b') | |
|
25 | 25 | |
|
26 | 26 | |
|
27 | 27 | def precheck(repo, revs, action=b'rewrite'): |
@@ -92,10 +92,10 b' def update_hash_refs(repo, commitmsg, pe' | |||
|
92 | 92 | if not pending: |
|
93 | 93 | pending = {} |
|
94 | 94 | cache = {} |
|
95 |
|
|
|
95 | hashes = re.findall(NODE_RE, commitmsg) | |
|
96 | 96 | unfi = repo.unfiltered() |
|
97 |
for |
|
|
98 |
fullnode = scmutil.resolvehexnodeidprefix(unfi, |
|
|
97 | for h in hashes: | |
|
98 | fullnode = scmutil.resolvehexnodeidprefix(unfi, h) | |
|
99 | 99 | if fullnode is None: |
|
100 | 100 | continue |
|
101 | 101 | ctx = unfi[fullnode] |
@@ -111,15 +111,15 b' def update_hash_refs(repo, commitmsg, pe' | |||
|
111 | 111 | # We can't make any assumptions about how to update the hash if the |
|
112 | 112 | # cset in question was split or diverged. |
|
113 | 113 | if len(successors) == 1 and len(successors[0]) == 1: |
|
114 |
newsh |
|
|
115 |
commitmsg = commitmsg.replace( |
|
|
114 | newhash = node.hex(successors[0][0]) | |
|
115 | commitmsg = commitmsg.replace(h, newhash[: len(h)]) | |
|
116 | 116 | else: |
|
117 | 117 | repo.ui.note( |
|
118 | 118 | _( |
|
119 | 119 | b'The stale commit message reference to %s could ' |
|
120 | 120 | b'not be updated\n' |
|
121 | 121 | ) |
|
122 |
% |
|
|
122 | % h | |
|
123 | 123 | ) |
|
124 | 124 | |
|
125 | 125 | return commitmsg |
General Comments 0
You need to be logged in to leave comments.
Login now