Bug 3970 - .hg/graftstate is not remove when aborting a graft.
Summary: .hg/graftstate is not remove when aborting a graft.
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 2.6.2
Hardware: Macintosh Mac OS
: urgent bug
Assignee: Siddharth Agarwal
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-25 18:44 UTC by Pierre-Yves David
Modified: 2013-07-23 18:43 UTC (History)
5 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre-Yves David 2013-06-25 18:44 UTC
When a graft is aborted with `hg update -C .` the .hg/grafstate file is not removed.

With the current stable branch (next stable release) we now prevent commit while a graft is in progress.

Not removing this file leave Mercurial in a "graft in progress" state and prevent further usage of the repo.

Repro scrip below


  $ hg init graft_bug
  $ cd graft_bug
  $ echo 'babar' > jungle
  $ hg add jungle
  $ hg ci -m 'add babar in jungle'
  $ echo 'celestine' >> jungle
  $ hg ci -m 'add celestine in jungle'
  $ hg up 0
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ echo 'zephir' >> jungle
  $ hg ci -m 'add zephir in jungle'
  created new head
  $ hg graft 1
  grafting revision 1
  merging jungle
  warning: conflicts during merge.
  merging jungle incomplete! (edit conflicts, then use 'hg resolve --mark')
  abandon : unresolved conflicts, can't continue
  (use hg resolve and hg graft --continue)
  $ hg up -C .
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ echo 'cornelius' >> jungle
  $ hg ci -m 'add cornelius in jungle'
  abandon : cannot commit an interrupted graft operation
  (use "hg graft -c" to continue graft)
Comment 1 Pierre-Yves David 2013-06-28 14:41 UTC
This regression is introduced by e078ea9b4ce4

graft: refuse to commit an interrupted graft (issue3667) 

A changeset first released in 2.6.2
Comment 2 HG Bot 2013-06-30 16:30 UTC
Fixed by http://selenic.com/repo/hg/rev/0af993732f66
Siddharth Agarwal <sid0@fb.com>
update: remove .hg/graftstate on clean (issue3970)

e078ea9b4ce4 introduced a check for interrupted grafts while committing. This
exposed a bug where hg update --clean didn't remove that file.

(please test the fix)