Creating empty revisions by committing and invalid .hgsub file

Mads Kiilerich mads at kiilerich.com
Sun Apr 1 11:31:45 UTC 2012


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.
>
> Steps to reproduce the problem:
>
> e:\>mkdir test-repo
> e:\>cd test-repo
> e:\test-repo>hg init
> e:\test-repo>mkdir include
> e:\test-repo>cd include
> e:\test-repo\include>mkdir subrepo
> e:\test-repo\include>cd subrepo
> e:\test-repo\include\subrepo>hg init
> e:\test-repo\include\subrepo>echo test>  test.txt
> e:\test-repo\include\subrepo>hg add test.txt
> e:\test-repo\include\subrepo>hg commit -m "added test.txt"
> e:\test-repo\include\subrepo>cd ..\..
> e:\test-repo>echo include\subrepo = include\subrepo>  .hgsub
> e:\test-repo>type .hgsub
> include\subrepo = include\subrepo
> e:\test-repo>hg status
> ? .hgsub
> e:\test-repo>hg add .hgsub
> e:\test-repo>hg status
> A .hgsub
> e:\test-repo>hg commit -m "add subrepo"

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.

> e:\test-repo>hg log
> changeset:   0:74328be82f96
> tag:         tip
> user:        aem
> date:        Fri Mar 30 08:32:22 2012 +0200
> summary:     add subrepo
>
> e:\test-repo>hg status
>
> e:\test-repo>hg commit -m "add subrepo again"
> e:\test-repo>hg commit -m "add subrepo again!"
> e:\test-repo>hg log
> changeset:   2:920acf421449
> tag:         tip
> user:        aem
> date:        Fri Mar 30 08:33:14 2012 +0200
> summary:     add subrepo again!
>
> changeset:   1:5dbb47f91bc7
> user:        aem
> date:        Fri Mar 30 08:33:10 2012 +0200
> summary:     add subrepo again
>
> changeset:   0:74328be82f96
> user:        aem
> date:        Fri Mar 30 08:32:22 2012 +0200
> summary:     add subrepo

What do these changesets contain? "hg log -v --debug"?


> e:\test-repo>rm .hgsub
> e:\test-repo>echo include/subrepo = include/subrepo>  .hgsub
> e:\test-repo>type .hgsub
> include/subrepo = include/subrepo
> e:\test-repo>hg status
> M .hgsub
> e:\test-repo>hg commit -m "fixed .hgsub"
> e:\test-repo>hg commit -m "commit again"
> nothing changed
>
> Is this normal? Shouldn't mercurial complain that the .hgsub format is
> wrong in the first place?

The first .hgsub you gave is not technically wrong ... but it is 
probably not what you want.

/Mads



More information about the Mercurial mailing list