From patchwork Fri Oct 16 01:57:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Bug, 4903] New: test-histedit-edit.t crash with general delta on by default. From: mercurial-bugs@selenic.com X-Patchwork-Id: 11131 Message-Id: To: mercurial-devel@selenic.com Date: Fri, 16 Oct 2015 01:57:33 +0000 https://bz.mercurial-scm.org/show_bug.cgi?id=4903 Bug ID: 4903 Summary: test-histedit-edit.t crash with general delta on by default. Product: Mercurial Version: default branch Hardware: PC OS: Linux Status: UNCONFIRMED Severity: feature Priority: wish Component: histedit Assignee: bugzilla@selenic.com Reporter: pierre-yves.david@ens-lyon.org CC: mercurial-devel@selenic.com check histedit_source $ hg log --debug --rev 5 changeset: 5:a5e1ba2f7afb899ef1581cea528fd885d2fca70d + tag: tip phase: draft parent: 4:1a60820cd1f6004a362aa622ebc47d59bc48eb34 parent: -1:0000000000000000000000000000000000000000 @@ -234,46 +262,35 @@ $ hg histedit tip --commands - 2>&1 < edit b5f70786f9b0 f > EOF - 0 files updated, 0 files merged, 1 files removed, 0 files unresolved - Make changes as needed, you may commit or record as needed now. - When you are finished, run hg histedit --continue to resume. + abort: uncommitted changes $ hg status - A f + A e $ hg summary - parent: 5:a5e1ba2f7afb - foobaz + parent: 3:055a42cdd887 + d branch: default commit: 1 added (new branch head) - update: 1 new changesets (update) - phases: 7 draft - hist: 1 remaining (histedit --continue) + update: 2 new changesets (update) + phases: 6 draft (test also that editor is invoked if histedit is continued for "edit" action) $ HGEDITOR='cat' hg histedit --continue - f - - - HG: Enter commit message. Lines beginning with 'HG:' are removed. - HG: Leave message empty to abort commit. - HG: -- - HG: user: test - HG: branch 'default' - HG: added f - 0 files updated, 0 files merged, 0 files removed, 0 files unresolved - saved backup bundle to $TESTTMP/r/.hg/strip-backup/b5f70786f9b0-c28d9c86-backup.hg (glob) + abort: no histedit in progress + [255] $ hg status + A e log after edit $ hg log --limit 1 - changeset: 6:a107ee126658 + changeset: 5:a5e1ba2f7afb tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 - summary: f + summary: foobaz say we'll change the message, but don't. @@ -282,15 +299,15 @@ > mv tmp "\$1" > EOF $ HGEDITOR="sh ../edit.sh" hg histedit tip 2>&1 | fixbundle - 0 files updated, 0 files merged, 1 files removed, 0 files unresolved - 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + abort: uncommitted changes $ hg status + A e $ hg log --limit 1 - changeset: 6:1fd3b2fe7754 + changeset: 5:a5e1ba2f7afb tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 - summary: f + summary: foobaz modify the message @@ -324,8 +341,7 @@ $ HGEDITOR="sh $TESTTMP/editor.sh" hg histedit tip --commands - 2>&1 << EOF | fixbundle > mess 1fd3b2fe7754 f > EOF - 0 files updated, 0 files merged, 1 files removed, 0 files unresolved - abort: emulating unexpected abort + abort: uncommitted changes $ test -f .hg/last-message.txt [1] @@ -334,6 +350,8 @@ > commitfailure = ! > EOF $ hg histedit --abort -q + abort: no histedit in progress + [255] (test that editor is invoked and commit message is saved into "last-message.txt") @@ -345,53 +363,24 @@ > EOF $ hg status --rev '1fd3b2fe7754^1' --rev 1fd3b2fe7754 - A f + abort: unknown revision '1fd3b2fe7754'! + [255] $ rm -f .hg/last-message.txt $ HGEDITOR="sh $TESTTMP/editor.sh" hg histedit tip --commands - 2>&1 << EOF > mess 1fd3b2fe7754 f > EOF - 0 files updated, 0 files merged, 1 files removed, 0 files unresolved - adding f - ==== before editing - f - - - HG: Enter commit message. Lines beginning with 'HG:' are removed. - HG: Leave message empty to abort commit. - HG: -- - HG: user: test - HG: branch 'default' - HG: added f - ==== - transaction abort! - rollback completed - note: commit message saved in .hg/last-message.txt - abort: pretxncommit.unexpectedabort hook exited with status 1 + abort: uncommitted changes [255] $ cat .hg/last-message.txt - f - - - check saving last-message.txt + cat: .hg/last-message.txt: No such file or directory + [1] (test also that editor is invoked if histedit is continued for "message" action) $ HGEDITOR=cat hg histedit --continue - f - - - HG: Enter commit message. Lines beginning with 'HG:' are removed. - HG: Leave message empty to abort commit. - HG: -- - HG: user: test - HG: branch 'default' - HG: added f - transaction abort! - rollback completed - note: commit message saved in .hg/last-message.txt - abort: pretxncommit.unexpectedabort hook exited with status 1 + abort: no histedit in progress [255] $ cat >> .hg/hgrc < pretxncommit.unexpectedabort = > EOF $ hg histedit --abort -q + abort: no histedit in progress + [255] then, check "modify the message" itself $ hg histedit tip --commands - 2>&1 << EOF | fixbundle > mess 1fd3b2fe7754 f > EOF - 0 files updated, 0 files merged, 1 files removed, 0 files unresolved - 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + abort: uncommitted changes $ hg status + A e $ hg log --limit 1 - changeset: 6:62feedb1200e + changeset: 5:a5e1ba2f7afb tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 - summary: f + summary: foobaz rollback should not work after a histedit ERROR: test-histedit-edit.t output changed --- /home/pyd/src/mercurial-dev/tests/test-histedit-edit.t +++ /home/pyd/src/mercurial-dev/tests/test-histedit-edit.t.err @@ -200,23 +200,51 @@ $ hg strip -q -r b5f70786f9b0 $ mv .hg/histedit-state.bak .hg/histedit-state $ hg histedit --abort - adding changesets - adding manifests - adding file changes - added 1 changesets with 1 changes to 3 files - 2 files updated, 0 files merged, 0 files removed, 0 files unresolved + warning: encountered an exception during histedit --abort; the repository may not have been completely cleaned up + ** unknown exception encountered, please report by visiting + ** https://mercurial-scm.org/wiki/BugTracker + ** Python 2.7.9 (default, Mar 1 2015, 12:57:24) [GCC 4.9.2] + ** Mercurial Distributed SCM (version 3.5.2+756-e8ff886ba364+20151015) + ** Extensions loaded: histedit, strip + Traceback (most recent call last): + File "/home/pyd/src/mercurial-dev/hg", line 43, in + mercurial.dispatch.run() + File "/home/pyd/src/mercurial-dev/mercurial/dispatch.py", line 54, in run + sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255) + File "/home/pyd/src/mercurial-dev/mercurial/dispatch.py", line 116, in dispatch + ret = _runcatch(req) + File "/home/pyd/src/mercurial-dev/mercurial/dispatch.py", line 187, in _runcatch + return _dispatch(req) + File "/home/pyd/src/mercurial-dev/mercurial/dispatch.py", line 920, in _dispatch + cmdpats, cmdoptions) + File "/home/pyd/src/mercurial-dev/mercurial/dispatch.py", line 679, in runcommand + ret = _runcommand(ui, options, cmd, d) + File "/home/pyd/src/mercurial-dev/mercurial/dispatch.py", line 1051, in _runcommand + return checkargs() + File "/home/pyd/src/mercurial-dev/mercurial/dispatch.py", line 1011, in checkargs + return cmdfunc() + File "/home/pyd/src/mercurial-dev/mercurial/dispatch.py", line 917, in + d = lambda: util.checksignature(func)(ui, *args, **cmdoptions) + File "/home/pyd/src/mercurial-dev/mercurial/util.py", line 801, in check + return func(*args, **kwargs) + File "/home/pyd/src/mercurial-dev/hgext/histedit.py", line 729, in histedit + _histedit(ui, repo, state, *freeargs, **opts) + File "/home/pyd/src/mercurial-dev/hgext/histedit.py", line 825, in _histedit + gen.apply(repo, 'histedit', 'bundle:' + backupfile) + AttributeError: 'unbundle20' object has no attribute 'apply' + [1] $ hg log -r . - changeset: 6:b5f70786f9b0 - tag: tip + changeset: 3:055a42cdd887 user: test date: Thu Jan 01 00:00:00 1970 +0000 - summary: f + summary: d