.hgsubstate not updated on "pull -u" or "update"

wrmarvin bill_marvin at hotmail.com
Sun Dec 9 01:06:26 UTC 2012


I am testing this problem and suggestions on a set of test repositories and 2
clones on my local PC.  I went back and deleted both working clones.  I then
created a new clone in both working 1 and working 2.  I made changes in
working 1 in the subrepo and the primary repo.  Committed the sub then the
primary. Pushed working 1 back to the "Master" repositories.

I change to the working 2 clone and proceeded as follows:
cd to subrepo and pull (no -u).
check primary status and all file are clean.
hg update subrepo working directory.
hg log of subrepo shows tip changeset is 5:52584d265d5d
cd to primary file in working 2.
check primary status and all file are clean.
look at .hgsubstate in notepad:

05dd8f74ee2be13bd634b3bbd4fb1e1073263d88 SubSharedCodeRepo

This corresponds to changeset:   4:05dd8f74ee2b (subrepo tip-1) as expected
since I have not pulled and updated the primary repo.

next pull (no -u) primary repo.
hg log of primary shows that tip is now correct to tip in the "Master" repo.
"hg status -A" shows all primary files are clean.
open .hgsubstate in notepad and the reference shown above is unchanged (I
have not done the update).
Now update the primary repo working directory to the tip.
"hg status -A" on primary repo shows "M" for .hgsubstate
open .hgsubstate in notepad:

05dd8f74ee2be13bd634b3bbd4fb1e1073263d88 SubSharedCodeRepo

The file is the same as it was before the update and is referencing tip-1 of
the subrepo even though a check of the subrepo parents returns:
5:52584d265d5d.

Now in primary repository do "hg revert -rtip .hgsubstate"
look at status now shows "C" for .hgsubstate
open in notpad shows:

52584d265d5db9e88698ca9c9d522c425e3c335e SubSharedCodeRepo

This corresponds to 5:52584d265d5d which is the parent of the subrepo, and
most importantly, is now the same .hgsubstate file that is in the tip of the
project in the "Master" repository.  Now, after the revert of the
.hgsubstate file, my files in working 2 are exactly the same as the files in
working 1 when the push from working 1 was done.  Also, now after the
revert, the files are the same as if I make a Working 3 directory and clone
from the "Master".

With further test, I have found an even bigger problem.  If I do not to a
"hg revert -rtip .hgsubstate" after the "hg pull -u" a big problem can
happen.  My sub repo code is updated to the latest code.  I do not have to
make changes to the code in the subrepo, but only make changes in the
primary repo code, recompile the project with the new primary and subrepo
code. Since I did not make any changes in the subrepo code, the status shows
clean, so I do not do a commit in the subrepo.  I do a commit in the primary
and then look at the status of the primary.  The .hgsubstate is still in "M"
status after the commit.  I just compiled with the subrepo working directory
at tip (5:52584d265d5d).  Opening .hgsubstate shows:

05dd8f74ee2be13bd634b3bbd4fb1e1073263d88 SubSharedCodeRepo

This is 4:05dd8f74ee2b (subrepo tip-1)

Now I push the project. No errors are reported.
I go to the "Master" repository and extract the .hgsubstate file from the
tip using revert (the Masters have no working directory).  Looking at this
.hgsubstate it shows:

52584d265d5db9e88698ca9c9d522c425e3c335e SubSharedCodeRepo

This is correct (5:52584d265d5d) for the state of the repo when I did the
compile, commit, and push, so at the "Master" repository level, all look OK,
but my local working copy of .hgsubstate is still not showing the correct
substate.  I would think that during the commit of the primary repo, the
.hgsubstate in the working directory would get updated to the parent
changeset of the subrepo.  Since it seems to fix itself on the push back to
the "Master", I guess all is OK.  It just does not seem like the timing of
the modification to .hgsubstate on pull -u and commits is what I would
expect.





--
View this message in context: http://mercurial.808500.n3.nabble.com/hgsubstate-not-updated-on-pull-u-or-update-tp3995591p3995623.html
Sent from the General mailing list archive at Nabble.com.



More information about the Mercurial mailing list