Mercurial in a wrong state?

I just did a fresh clone, yet “hg id” returns

9a17e0834c4e+ tip @

Or after “hg update stable”

hg id
c0e14e924dab+ (stable)

Plus ("+") at the end usually means local changes, but I do not have any.
What is happening?

That was me again.

@jwe managed to fix the repo after the last time that happened. Could you please do that again?

I don’t see the error now. I just cloned into an empty directory using hg clone ssh://hg.sv.gnu.org/octave. The output of hg glog begins with

@  changeset:   29841:9a17e0834c4e
|  bookmark:    @
|  tag:         tip
|  user:        Markus Mützel <markus.muetzel@gmx.de>
|  date:        Tue Jun 29 19:31:26 2021 +0200
|  summary:     GitHub-CI: Decrease time-out for some steps.

and hg id reports 9a17e0834c4e tip @.


[dima@dasp53 octave]$ hg update
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
[dima@dasp53 octave]$ hg head
changeset:   29841:9a17e0834c4e
bookmark:    @
tag:         tip
user:        Markus Mützel <markus.muetzel@gmx.de>
date:        Tue Jun 29 19:31:26 2021 +0200
summary:     GitHub-CI: Decrease time-out for some steps.

changeset:   29839:c0e14e924dab
branch:      stable
parent:      29837:1a7ed0751cd6
user:        Markus Mützel <markus.muetzel@gmx.de>
date:        Tue Jun 29 19:19:31 2021 +0200
summary:     build: Fix file name.

[dima@dasp53 octave]$ hg id
9a17e0834c4e+ tip @

when off of an outdated clean state i do a pull/update i get the following:

$ hg summ
parent: 29841:9a17e0834c4e tip
 GitHub-CI: Decrease time-out for some steps.
branch: default
bookmarks: @
commit: 1 modified
update: (current)

$ hg stat
M etc\NEWS.6

trying to test a patch i get a

$ hg patch  --no-commit ../bug60818-delaunayn-v3.patch
abort: uncommitted changes

using hg strip to force it back through commits, I go back three to get to a clean state:

$ hg strip -f --no-backup -r tip
2 files updated, 0 files merged, 0 files removed, 0 files unresolved

$ hg summ
parent: 29840:1a0a71a77614 tip
 maint: Merge stable to default.
branch: default
bookmarks: @
commit: 1 modified
update: (current)

$ hg strip -f --no-backup -r tip
2 files updated, 0 files merged, 0 files removed, 0 files unresolved

$ hg summ
parent: 29839:0d511d53dd55 tip
 maint: Merge stable to default.
branch: default
bookmarks: @
commit: 1 modified
update: (current)

$ hg strip -f --no-backup -r tip
2 files updated, 0 files merged, 0 files removed, 0 files unresolved

$ hg summ
parent: 29838:56465c0739fa tip
 allow release notes window to be opened from command line
branch: default
bookmarks: @
commit: (clean)
update: (current)

I’m not seeing the problem this time. When I did see the problem some time ago, one file showed as modified but hg diff showed no changes. If I recall correctly, doing an hg commit fixed it. That was this changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/952f1ad2dd8d

from my end it seems I’m seeing the same thing with etc/NEWS.6 as last time.

@nrjank If you commit the “changes” to etc/NEWS.6 in your copy of the repo, does the problem go away?

i think so? (HG neophyte. I usually just pull a clean slate, make changes, ci/export a patch, then strip back to latest clean source state for next patch.)

$ hg commit

$ hg summ
parent: 29841:e8a715b84f2f tip
 test
branch: default
commit: (clean)
update: (current)
phases: 1 draft

$ hg stat

$

making a couple test changes followed by hg ci / hg export shows I have 2 drafts sitting, but the commit for the NEWS file doesn’t seem to affect anything (doesn’t show up as an edited file, etc. in the exported patch).

of course now I did a hg pull to grab the latest change and I get:

$ hg up
abort: not a linear update
(merge or update --check to force update)

safe to assume forcing the update should be fine since it didn’t actually make any changes that could conflict?

ETA: um, maybe not? now i have:

$ hg up --check
3 files updated, 0 files merged, 0 files removed, 0 files unresolved

$ hg sum
parent: 29842:9a17e0834c4e tip
 GitHub-CI: Decrease time-out for some steps.
branch: default
bookmarks: @
commit: 1 modified
update: 1 new changesets, 2 branch heads (merge)
phases: 1 draft

$ hg stat
M etc\NEWS.6

After reading

I thought maybe hg debugrebuilddirstate would be the fix you need. But then I ran it on my apparently clean repo and now I see the weird modified etc/NEWS.6 file! Very strange.

Anyway, I committed the “changes” and pushed. Let me know if you still see the problem now after updating.

I still see the problem on stable (OK on dev).

$ hg up
4 files updated, 0 files merged, 0 files removed, 0 files unresolved

$ hg summ
parent: 29842:9ede1179a1ee tip
 fix corrupt status of etc/NEWS.6 in repo?
branch: default
bookmarks: @
commit: (clean)
update: (current)

not seeing it on stable either:

$ hg update stable
1633 files updated, 0 files merged, 129 files removed, 0 files unresolved

$ hg summ
parent: 29836:c0e14e924dab
 build: Fix file name.
branch: stable
commit: (clean)
update: (current)


I cloned a new one and it is OK now.

On my end everything is fine now, too :+1:

Thanks for fixing this (again).
I’m sorry to have caused this again. I’ll try to remember to ask someone else to merge after changing the NEWS file in the future.

@mmuetzel don’t feel discouraged, that is what Mercurial is for :slightly_smiling_face: It would be far worse if something was altered and nobody would notice it.

Last time I did a change on stable with announcement in the NEWS file and merge to default (3 weeks ago octave: 5ed71a4cd578) it also (locally!) went wrong using TortoiseHG. I am always very unhappy if Mercurial reports it cannot resolve conflicts automatically :exploding_head: Before pushing to default after a merge to default and incomprehensible tool resolution magic, I pedantically check the contents of the NEWS and /etc/NEWS.6 file. It seems there is nothing else one can do about it :man_shrugging:

The strange thing is that it looks fine locally for me before pushing the changes.
But after pushing to the online repository and checking out a fresh copy, the file is marked as modified (without any visible changes…).

When you do the merge, are there conflicts? If so, exactly how do you resolve them? Also, what version of mercurial are you uisng?

I’m using Mercurial 5.8 mostly with TortoiseHg as an interface.

I have one “main” repository that I only use for synchronizing changes with the online repository. That is usually on the default branch.
I cloned that repository to another local repository (or multiple others) were I do the actual changes. For that particular change, I used the clone that is usually tracking the stable branch.
I pushed the changes from that repository to the “main” repository.
In the “main” repository, I tried to merge the changes from the stable branch to the default branch.
If I remember correctly, there were conflicts. The merge from the NEWS from stable to NEWS.6 on default went without “complaining”. But it tried to merge the changes from the NEWS file in the stable tree to the NEWS file in the default tree. When prompted, I selected to use the local copy of the file (ignoring the changes from the stable branch).
After that, I committed the merge to the “main” repository. At that point, there were no local uncommitted changes in the “main” repository. Then, I pushed the changes to the online repository.