[Bug 4622] New: .hgsubstate is corrupted after merging and resolving subrepos

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Fri Apr 24 15:16:12 CDT 2015


http://bz.selenic.com/show_bug.cgi?id=4622

          Priority: normal
            Bug ID: 4622
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: .hgsubstate is corrupted after merging and resolving
                    subrepos
          Severity: bug
    Classification: Unclassified
                OS: Windows
          Reporter: swpalmer at gmail.com
          Hardware: PC
            Status: UNCONFIRMED
           Version: 3.3.3
         Component: Mercurial
           Product: Mercurial

The following Windows batch file will reproduce the problem. The hash will go
missing from .hgsubstate for a particular subrepo.



@echo off
REM Steps to reproduce in this exact chronological order:
REM System A and System B both have an identical clone of repo XXX which only
subrepo YY
REM System A
REM Change something in YY; don't commit
REM Clone in a new subrepo ZZ; update .hgsub; can't commit .hgsub because of
the uncommitted changes in YY
REM System B:
REM Implement a change in YY and commit + push
REM System A:
REM While the changes are still all uncommitted, 'hg pull' to grab the changes
in YY
REM Notice how the root level .hgsubstate is corrupted as it relates to subrepo
ZZ

hg init XXX
cd XXX
hg init YY
echo YY=YY>.hgsub
hg add .hgsub
cd YY
echo Hi >>yy.txt
hg addremove
cd ..
hg init ZZ
cd ZZ
echo zzz>zz.txt
hg addremove
hg ci -m "initial ZZ"
REM ZZ not a subrepo yet
cd ..
hg ci -S -m  "Initial XXX repo with subrepo"

cd ..
hg clone XXX A
hg clone XXX B

cd B
echo whatever >>YY\yy.txt
hg ci -S -m "Tweaked subrepo"
hg push

cd ..\A
echo Mom >>YY\yy.txt
hg clone ..\XXX\ZZ
echo ZZ=ZZ>>.hgsub
cd ZZ
echo whatever >>zz.txt
cd ..
REM "Added a new subrepo"

echo.
echo.
echo Pick (M)erge for diverged subrepo, then pick (r)remote for subrepository
sources (manually resolve conflict)
echo.
echo.
hg pull -u

echo Now .hgsubstate is corrupted
hg st
type .hgsubstate

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list