diff --git a/mercurial/rewriteutil.py b/mercurial/rewriteutil.py --- a/mercurial/rewriteutil.py +++ b/mercurial/rewriteutil.py @@ -207,7 +207,12 @@ def update_hash_refs(repo, commitmsg, pe hashes = re.findall(NODE_RE, commitmsg) unfi = repo.unfiltered() for h in hashes: - fullnode = scmutil.resolvehexnodeidprefix(unfi, h) + try: + fullnode = scmutil.resolvehexnodeidprefix(unfi, h) + except error.WdirUnsupported: + # Someone has an fffff... in a commit message we're + # rewriting. Don't try rewriting that. + continue if fullnode is None: continue ctx = unfi[fullnode] diff --git a/tests/test-rebase-inmemory.t b/tests/test-rebase-inmemory.t --- a/tests/test-rebase-inmemory.t +++ b/tests/test-rebase-inmemory.t @@ -971,9 +971,9 @@ Test that update_hash_refs works. $ hg ci -m 'this will change hash' created new head $ echo changed >> update_hash_refs - $ hg ci -m "this starts as the child of `hg log -r . -T'{node|short}'` but not 506e2454484b" + $ hg ci -m "this starts as the child of `hg log -r . -T'{node|short}'` but not 506e2454484b. Also, ffffffffffffffff" $ hg tglog - @ 5: becd28036887 'this starts as the child of 98789aa60148 but not 506e2454484b' + @ 5: a8b42cbbde83 'this starts as the child of 98789aa60148 but not 506e2454484b. Also, ffffffffffffffff' | o 4: 98789aa60148 'this will change hash' | @@ -987,10 +987,10 @@ Test that update_hash_refs works. $ hg rebase -r '.^::' -d 3 rebasing 4:98789aa60148 "this will change hash" - rebasing 5:becd28036887 tip "this starts as the child of 98789aa60148 but not 506e2454484b" - saved backup bundle to $TESTTMP/keep_merge/.hg/strip-backup/98789aa60148-72ec40bd-rebase.hg + rebasing 5:a8b42cbbde83 tip "this starts as the child of 98789aa60148 but not 506e2454484b. Also, ffffffffffffffff" + saved backup bundle to $TESTTMP/keep_merge/.hg/strip-backup/98789aa60148-da3f4c2c-rebase.hg $ hg tglog - @ 5: a445b8426f4b 'this starts as the child of c16c25696fe7 but not 506e2454484b' + @ 5: 0fd2912e6cc1 'this starts as the child of c16c25696fe7 but not 506e2454484b. Also, ffffffffffffffff' | o 4: c16c25696fe7 'this will change hash' |