Creating empty revisions by committing and invalid .hgsub file
Angel Ezquerra
angel.ezquerra at gmail.com
Mon Apr 2 08:55:02 UTC 2012
On Sun, Apr 1, 2012 at 1:31 PM, Mads Kiilerich <mads at kiilerich.com> wrote:
> Angel Ezquerra Moreu wrote, On 03/30/2012 08:38 AM:
>
>> Hi,
>>
>> today I managed to create several empty revisions by creating a
>> malformed .hgsub file.
>>
[...]
>
> The problem can not be reproduced on Linux.
>
> Here Mercurial should have said "committing subrepository include\subrepo"
> and .hgsubstate should contain "0000000000000000000000000000000000000000
> include\subrepo".
>
> Please verify that you can reproduce the problem with the latest Mercurial.
>
[...]
>
> What do these changesets contain? "hg log -v --debug"?
>
Mads, thanks for your help.
I just ran the test again. I modified my original script so that it
explicitly calls the hg executable located on "c:\Program
Files\Mercurial", and which shows that the mercurial version is 2.1.1.
I also changed the calls to hg log into hg log -v --debug as you
requested. The result is the same:
Microsoft Windows [Versión 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Reservados todos los derechos.
C:\Users\aem>e:
E:\>hg_script.bat
E:\>e:
E:\>cd e:\
E:\>mkdir test-repo
E:\>cd test-repo
E:\test-repo>c"c:\Program Files\Mercurial\hg.exe" --version
El nombre de archivo, el nombre de directorio o la sintaxis de la etiqueta del v
olumen no son correctos.
E:\test-repo>"c:\Program Files\Mercurial\hg.exe" init
E:\test-repo>mkdir subrepo
E:\test-repo>cd subrepo
E:\test-repo\subrepo>"c:\Program Files\Mercurial\hg.exe" init
E:\test-repo\subrepo>echo test > test.txt
E:\test-repo\subrepo>type test.txt
test
E:\test-repo\subrepo>"c:\Program Files\Mercurial\hg.exe" add test.txt
E:\test-repo\subrepo>"c:\Program Files\Mercurial\hg.exe" commit -m "added test.t
xt"
E:\test-repo\subrepo>cd ..
E:\test-repo>echo include\subrepo = include\subrepo > .hgsub
E:\test-repo>type .hgsub
include\subrepo = include\subrepo
E:\test-repo>"c:\Program Files\Mercurial\hg.exe" status
? .hgsub
E:\test-repo>"c:\Program Files\Mercurial\hg.exe" add .hgsub
E:\test-repo>"c:\Program Files\Mercurial\hg.exe" status
A .hgsub
E:\test-repo>"c:\Program Files\Mercurial\hg.exe" commit -m "add subrepo"
committing subrepository include\subrepo
E:\test-repo>"c:\Program Files\Mercurial\hg.exe" log -v --debug
changeset: 0:33c71447a927edddeb0c1613411152c04cad4888
tag: tip
phase: draft
parent: -1:0000000000000000000000000000000000000000
parent: -1:0000000000000000000000000000000000000000
manifest: 0:95de667a6dedb615cccabb595783606b248d7265
user: aem
date: Mon Apr 02 10:47:34 2012 +0200
files+: .hgsub .hgsubstate
extra: branch=default
description:
add subrepo
E:\test-repo>"c:\Program Files\Mercurial\hg.exe" status
E:\test-repo>"c:\Program Files\Mercurial\hg.exe" commit -m "add subrepo again"
committing subrepository include\subrepo
E:\test-repo>"c:\Program Files\Mercurial\hg.exe" commit -m "add subrepo again!"
committing subrepository include\subrepo
E:\test-repo>"c:\Program Files\Mercurial\hg.exe" log -v --debug
changeset: 2:352c9282ad0043adc4a495050b5fdd9529a8c1da
tag: tip
phase: draft
parent: 1:bfcfa1d02bec264a4b8df1494f440e2b4d25d3f1
parent: -1:0000000000000000000000000000000000000000
manifest: 2:734b6dc72796ece5fd8535fbb15dabce3641108e
user: aem
date: Mon Apr 02 10:47:35 2012 +0200
extra: branch=default
description:
add subrepo again!
changeset: 1:bfcfa1d02bec264a4b8df1494f440e2b4d25d3f1
phase: draft
parent: 0:33c71447a927edddeb0c1613411152c04cad4888
parent: -1:0000000000000000000000000000000000000000
manifest: 1:77811a15fdbf02a5906e584ba00ab8f5ac74b093
user: aem
date: Mon Apr 02 10:47:34 2012 +0200
extra: branch=default
description:
add subrepo again
changeset: 0:33c71447a927edddeb0c1613411152c04cad4888
phase: draft
parent: -1:0000000000000000000000000000000000000000
parent: -1:0000000000000000000000000000000000000000
manifest: 0:95de667a6dedb615cccabb595783606b248d7265
user: aem
date: Mon Apr 02 10:47:34 2012 +0200
files+: .hgsub .hgsubstate
extra: branch=default
description:
add subrepo
E:\test-repo>del .hgsub
E:\test-repo>echo include/subrepo = include/subrepo >.hgsub
E:\test-repo>type .hgsub
include/subrepo = include/subrepo
E:\test-repo>"c:\Program Files\Mercurial\hg.exe" status
M .hgsub
E:\test-repo>"c:\Program Files\Mercurial\hg.exe" commit -m "fixed .hgsub"
E:\test-repo>"c:\Program Files\Mercurial\hg.exe" commit -m "commit again"
nothing changed
E:\test-repo>"c:\Program Files\Mercurial\hg.exe" log -v --debug
changeset: 3:482cb931b43b4a9de75811cdb1a95808164eb968
tag: tip
phase: draft
parent: 2:352c9282ad0043adc4a495050b5fdd9529a8c1da
parent: -1:0000000000000000000000000000000000000000
manifest: 3:33ecd98bd8309ff59af110b3d8bdcd04459f6848
user: aem
date: Mon Apr 02 10:47:35 2012 +0200
files: .hgsub
extra: branch=default
description:
fixed .hgsub
changeset: 2:352c9282ad0043adc4a495050b5fdd9529a8c1da
phase: draft
parent: 1:bfcfa1d02bec264a4b8df1494f440e2b4d25d3f1
parent: -1:0000000000000000000000000000000000000000
manifest: 2:734b6dc72796ece5fd8535fbb15dabce3641108e
user: aem
date: Mon Apr 02 10:47:35 2012 +0200
extra: branch=default
description:
add subrepo again!
changeset: 1:bfcfa1d02bec264a4b8df1494f440e2b4d25d3f1
phase: draft
parent: 0:33c71447a927edddeb0c1613411152c04cad4888
parent: -1:0000000000000000000000000000000000000000
manifest: 1:77811a15fdbf02a5906e584ba00ab8f5ac74b093
user: aem
date: Mon Apr 02 10:47:34 2012 +0200
extra: branch=default
description:
add subrepo again
changeset: 0:33c71447a927edddeb0c1613411152c04cad4888
phase: draft
parent: -1:0000000000000000000000000000000000000000
parent: -1:0000000000000000000000000000000000000000
manifest: 0:95de667a6dedb615cccabb595783606b248d7265
user: aem
date: Mon Apr 02 10:47:34 2012 +0200
files+: .hgsub .hgsubstate
extra: branch=default
description:
add subrepo
>
> The first .hgsub you gave is not technically wrong ... but it is probably
> not what you want.
Sorry, what do you mean? Do you mean that the first .hgsub file is
saying that there is a subrepo in a folder called "include\subrepo"
(where "\" is part of the folder name?). If so that is definitely
wrong on windows, where (AFAIK) that folder name is invalid.
If that is the case I think it is all too easy to make this mistake on windows.
Angel
More information about the Mercurial
mailing list