Bug 2445 - SVN Subrepositories will always commit empty changesets
Summary: SVN Subrepositories will always commit empty changesets
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: All All
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-19 08:55 UTC by Scott Palmer
Modified: 2012-05-13 05:08 UTC (History)
4 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Palmer 2010-10-19 08:55 UTC
Commiting from a master repo that contains subversion subrepos (directly or
nested in mercurial subrepos that have their own subversion subrepos) always
creates a changeset regardless of if there are changes.


To reproduce create a repo with a subversion subrepo and commit several
times in a row without creating any changes.  You will always get the
message "committing subrepositry XXXXX" and unless there were real changes,
the changeset created is empty.

e.g. given a layout like:

mercMaster
+-mercSubrepo
  +-svnSubrepoOfMercSubrepo

Commits to mercSubrepo will always produce a changeset, because it has a
subversion subrepository.  This changes set will be an empty one if there
are no actual changes.

Commits to mercMaster will see the change in mercSubrepo caused by the empty
changeset and therefore the .hgsubstate file of the master repo is changed
to reflect the new tip of the nested Mercurial subrepo.

This leads to harmless but unnecessary and confusing noise in the repo history.
Comment 1 Martin Geisler 2010-10-21 02:13 UTC
I can confirm this by applying this patch to test-subrepo-svn.t:

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
@@ -199,3 +199,18 @@
 
   $ python -c "import os.path; print os.path.exists('s')"
   True
+
+commit with clean subrepo:
+
+  $ hg commit -v -m 'should fail'
+  committing subrepository s
+  .hgsubstate
+  committed changeset 3:5fb978f01209
+  $ hg export tip
+  # HG changeset patch
+  # User test
+  # Date 0 0
+  # Node ID 5fb978f0120981a1d50b174a13c34122b48b719c
+  # Parent  a49f1597d7aa960b82dc4e85528005d8102ba2ca
+  should fail
+  


The changeset hash of the last changesets are not stable and I don't know
why yet. I'll dig some more now.
Comment 2 HG Bot 2010-10-21 03:00 UTC
Fixed by http://hg.intevation.org/mercurial/crew/rev/3d6ba8c2b1b8
Matt Mackall <mpm@selenic.com>
subrepo: fix status check on SVN subrepos (issue2445)
Comment 3 Bugzilla 2012-05-12 09:13 UTC

--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:13 EDT  ---

This bug was previously known as _bug_ 2445 at http://mercurial.selenic.com/bts/issue2445