subrepo: fix status check on SVN subrepos (issue2445) stable
authorMatt Mackall <mpm@selenic.com>
Thu, 21 Oct 2010 03:28:51 -0500
branchstable
changeset 12798 3d6ba8c2b1b8
parent 12797 076bbbf0ba86
child 12799 8f71e5074e3c
child 12832 64f5ae917020
subrepo: fix status check on SVN subrepos (issue2445)
mercurial/subrepo.py
tests/test-subrepo-svn.t
--- a/mercurial/subrepo.py	Thu Oct 21 03:18:52 2010 +0200
+++ b/mercurial/subrepo.py	Thu Oct 21 03:28:51 2010 -0500
@@ -491,7 +491,7 @@
         entries = doc.getElementsByTagName('entry')
         if not entries:
             return 0
-        return int(entries[0].getAttribute('revision') or 0)
+        return str(entries[0].getAttribute('revision')) or '0'
 
     def _wcchanged(self):
         """Return (changes, extchanges) where changes is True
--- a/tests/test-subrepo-svn.t	Thu Oct 21 03:18:52 2010 +0200
+++ b/tests/test-subrepo-svn.t	Thu Oct 21 03:28:51 2010 -0500
@@ -69,6 +69,18 @@
   $ hg ci -m1
   committing subrepository s
 
+make sure we avoid empty commits (issue2445)
+
+  $ hg sum
+  parent: 1:* tip (glob)
+   1
+  branch: default
+  commit: (clean)
+  update: (current)
+  $ hg ci -moops
+  nothing changed
+  [1]
+
 debugsub
 
   $ hg debugsub
@@ -80,6 +92,12 @@
 
   $ echo a >> a
   $ echo alpha >> s/alpha
+  $ hg sum
+  parent: 1:* tip (glob)
+   1
+  branch: default
+  commit: 1 modified, 1 subrepos
+  update: (current)
   $ hg commit -m 'Message!'
   committing subrepository s
   Sending*s/alpha (glob)