Bug 5677 - subrepo change can no longer be amended
Summary: subrepo change can no longer be amended
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 4.4
Hardware: PC Linux
: normal bug
Assignee: Yuya Nishihara
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2017-09-12 09:26 UTC by Yuya Nishihara
Modified: 2017-12-06 00:00 UTC (History)
2 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 Yuya Nishihara 2017-09-12 09:26 UTC
Since e8a7c1a0565a "cmdutil: remove the redundant commit during amend",
subrepo change is no longer be detected so .hgsubstate can't be amended.

  $ hg init t
  $ cd t
  $ echo a > a
  $ hg ci -Am0
  adding a
  $ echo s = s > .hgsub
  $ hg add .hgsub
  $ hg init s
  $ echo a > s/a
  $ hg ci -R s -Am0
  adding a
  $ hg ci -m1

  $ hg up -R s null
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
  $ hg ci --amend -m1
  nothing changed
  [1]

BROKEN: .hgsubstate should be amended

Perhaps we'll need to extract the preprocess of localrepository.commit().
Comment 1 Bugzilla 2017-11-19 00:00 UTC
Bug was set to IN_PROGRESS for 14 days, moving back to confirmed
Comment 2 HG Bot 2017-11-28 22:25 UTC
Fixed by https://mercurial-scm.org/repo/hg/rev/691524f0bbf6
Yuya Nishihara <yuya@tcha.org>
amend: update .hgsubstate before committing a memctx (issue5677)

This is a minimal copy of localrepo.commit(). As the current amend() function
heavily depends on the wctx API, it wasn't easy to port it to use a separate
status tuple. So for now, wctx._status is updated in-place.

(please test the fix)
Comment 3 Bugzilla 2017-12-06 00:00 UTC
Bug was set to TESTING for 7 days, resolving