[PATCH] subrepo: avoids empty commit when .hgsubstate is dirty (issue2403)

Mads Kiilerich mads at kiilerich.com
Thu Dec 16 20:38:35 CST 2010


Erik Zielke wrote, On 11/29/2010 09:38 AM:
> # HG changeset patch
> # User Erik Zielke<ez at aragost.com>
> # Date 1291019843 -3600
> # Node ID b1bcf90cb59e3c92708acd5d894ed65d8a3cd30b
> # Parent  da69a1597285fe25eeedab1a45869487773b715b
> subrepo: avoids empty commit when .hgsubstate is dirty (issue2403)

Combining an (otherwise) ignored dirty .hgsubstate still gives some 
strange results:

diff --git a/tests/test-subrepo-empty-commit.t 
b/tests/test-subrepo-empty-commit.t
--- a/tests/test-subrepo-empty-commit.t
+++ b/tests/test-subrepo-empty-commit.t
@@ -28,6 +28,34 @@
    nothing changed
    [1]

+but this looks suspicious:
+
+  $ hg id sub
+  5bbc614a5b06 tip
+  $ echo c1b > f1
+  $ hg commit -m1
+  committing subrepository sub
+  $ hg log -p -r tip
+  changeset:   1:c377c139cf3c
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1
+
+  diff -r 853ea21970bb -r c377c139cf3c .hgsubstate
+  --- a/.hgsubstate    Thu Jan 01 00:00:00 1970 +0000
+  +++ b/.hgsubstate    Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,1 +1,1 @@
+  -5bbc614a5b06ad7f3bf7c2463d74b005324f34c1 sub
+  +0000000000000000000000000000000000000000 sub
+  diff -r 853ea21970bb -r c377c139cf3c f1
+  --- a/f1    Thu Jan 01 00:00:00 1970 +0000
+  +++ b/f1    Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,1 +1,1 @@
+  -c1
+  +c1b
+
+
  an okay update of .hgsubstate
    $ cd sub
    $ echo c3 > f2
@@ -49,7 +77,7 @@
    committing subrepository sub
    $ echo '0000000000000000000000000000000000000000 sub' > .hgsubstate
    $ hg diff --nodates
-  diff -r 41e1dee3d5d9 .hgsubstate
+  diff -r b52e776d6fc4 .hgsubstate
    --- a/.hgsubstate
    +++ b/.hgsubstate
    @@ -1,1 +1,1 @@


Is that correct and intended?

/Mads


More information about the Mercurial-devel mailing list