diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -491,7 +491,7 @@ class svnsubrepo(abstractsubrepo): 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 diff --git a/tests/test-subrepo-svn.t b/tests/test-subrepo-svn.t --- a/tests/test-subrepo-svn.t +++ b/tests/test-subrepo-svn.t @@ -69,6 +69,18 @@ add first svn sub with leading whitespac $ 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 @@ change file in svn and hg, commit $ 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)