Bug 5494 - resolve --list continues to display results after rebase completes
Summary: resolve --list continues to display results after rebase completes
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: rebase (show other bugs)
Version: 4.1-rc
Hardware: All All
: wish bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-02 00:29 UTC by Ryan McElroy
Modified: 2018-03-17 00:00 UTC (History)
3 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 Ryan McElroy 2017-03-02 00:29 UTC
In some circumstances after a rebase, the merge state is not properly removed, and `hg resolve --list` continues to show files as "resolved" when there should no longer be a merge state at all.

This inside of a test file reproduces the problem:

"""
  $ cat >> $HGRCPATH <<EOF
  > [extensions]
  > rebase=
  > EOF
  $ hg init repo
  $ cd repo
  $ echo a >> a
  $ hg commit -qAm base
  $ echo b >> a
  $ hg commit -qm b
  $ hg up .^
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ echo c >> a
  $ hg commit -qm c
  $ hg rebase -s 1 -d 2 --noninteractive
  rebasing 1:fdaca8533b86 "b"
  merging a
  warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
  unresolved conflicts (see hg resolve, then hg rebase --continue)
  [1]
  $ echo a > a
  $ echo c >> a
  $ hg resolve --mark a
  (no more unresolved files)
  continue: hg rebase --continue
  $ hg rebase --continue
  rebasing 1:fdaca8533b86 "b"
  note: rebase of 1:fdaca8533b86 created no changes to commit
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/fdaca8533b86-7fd70513-backup.hg (glob)
  $ hg resolve --list
  R a
  $ ls .hg/merge
  86f7e437faa5a7fce15d1ddcb9eaeaea377667b8
  state
  state2
"""

Note that .hg/merge should have been deleted but it wasn't, and that the user-visible error here is that `hg resolve --list` shows a file when there should be no merge state at all.
Comment 1 Ryan McElroy 2017-07-21 11:13 UTC
This was fixed by a580b2d65ded988da1b06e4300d05dcb0b95b352
Comment 2 HG Bot 2018-03-09 08:20 UTC
Fixed by https://mercurial-scm.org/repo/hg/rev/c164a3a282c1
Martin von Zweigbergk <martinvonz@google.com>
tests: .hg/merge is a directory, so use `test -d`

This part of test-rebase-interrupts.t would have passed before the fix
in a580b2d65ded (rebase: make sure merge state is cleaned up for no-op
rebases (issue5494), 2017-05-18).

Differential Revision: https://phab.mercurial-scm.org/D2713

(please test the fix)
Comment 3 Bugzilla 2018-03-17 00:00 UTC
Bug was set to TESTING for 7 days, resolving