changeset 587:e77ef6cd4ddb

Incremental patch for VCS root with subrepos
author Dmitry Neverov <dmitry.neverov@jetbrains.com>
date Tue, 16 Apr 2013 16:20:30 +0400
parents aa515fa1f626
children 868916a31d88
files mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/HgRepo.java mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialSupportBuilder.java mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/SubrepoPatchTest.java mercurial-tests/testData/inc_patch_subrepo_added/after/.hgsub mercurial-tests/testData/inc_patch_subrepo_added/after/.hgsubstate mercurial-tests/testData/inc_patch_subrepo_added/after/a mercurial-tests/testData/inc_patch_subrepo_added/after/r2/c mercurial-tests/testData/inc_patch_subrepo_added/before/.hgsub mercurial-tests/testData/inc_patch_subrepo_added/before/.hgsubstate mercurial-tests/testData/inc_patch_subrepo_added/before/a mercurial-tests/testData/inc_patch_subrepo_removed/after/.hgsub mercurial-tests/testData/inc_patch_subrepo_removed/after/.hgsubstate mercurial-tests/testData/inc_patch_subrepo_removed/after/a mercurial-tests/testData/inc_patch_subrepo_removed/before/.hgsub mercurial-tests/testData/inc_patch_subrepo_removed/before/.hgsubstate mercurial-tests/testData/inc_patch_subrepo_removed/before/a mercurial-tests/testData/inc_patch_subrepo_removed/before/r2/b mercurial-tests/testData/inc_patch_subrepo_revision_changed/after/.hgsub mercurial-tests/testData/inc_patch_subrepo_revision_changed/after/.hgsubstate mercurial-tests/testData/inc_patch_subrepo_revision_changed/after/a mercurial-tests/testData/inc_patch_subrepo_revision_changed/after/r2/c mercurial-tests/testData/inc_patch_subrepo_revision_changed/before/.hgsub mercurial-tests/testData/inc_patch_subrepo_revision_changed/before/.hgsubstate mercurial-tests/testData/inc_patch_subrepo_revision_changed/before/a mercurial-tests/testData/inc_patch_subrepo_revision_changed/before/r2/c mercurial-tests/testData/inc_patch_subrepo_url_changed/after/.hgsub mercurial-tests/testData/inc_patch_subrepo_url_changed/after/.hgsubstate mercurial-tests/testData/inc_patch_subrepo_url_changed/after/a mercurial-tests/testData/inc_patch_subrepo_url_changed/after/r2/.hgsub mercurial-tests/testData/inc_patch_subrepo_url_changed/after/r2/.hgsubstate mercurial-tests/testData/inc_patch_subrepo_url_changed/after/r2/c mercurial-tests/testData/inc_patch_subrepo_url_changed/after/r2/r2/b mercurial-tests/testData/inc_patch_subrepo_url_changed/before/.hgsub mercurial-tests/testData/inc_patch_subrepo_url_changed/before/.hgsubstate mercurial-tests/testData/inc_patch_subrepo_url_changed/before/a mercurial-tests/testData/inc_patch_subrepo_url_changed/before/r2/b mercurial-tests/testData/inc_patch_subrepo_with_checkout_rules/after/subdir/.hgsub mercurial-tests/testData/inc_patch_subrepo_with_checkout_rules/after/subdir/.hgsubstate mercurial-tests/testData/inc_patch_subrepo_with_checkout_rules/after/subdir/a mercurial-tests/testData/inc_patch_subrepo_with_checkout_rules/after/subdir/r2/c mercurial-tests/testData/inc_patch_subrepo_with_checkout_rules/before/subdir/.hgsub mercurial-tests/testData/inc_patch_subrepo_with_checkout_rules/before/subdir/.hgsubstate mercurial-tests/testData/inc_patch_subrepo_with_checkout_rules/before/subdir/a mercurial-tests/testData/inc_patch_subrepo_with_checkout_rules/before/subdir/r2/c mercurial-tests/testData/inc_patch_subrepo_with_excluding_checkout_rules/after/subdir/.hgsub mercurial-tests/testData/inc_patch_subrepo_with_excluding_checkout_rules/after/subdir/.hgsubstate mercurial-tests/testData/inc_patch_subrepo_with_excluding_checkout_rules/after/subdir/a mercurial-tests/testData/inc_patch_subrepo_with_excluding_checkout_rules/before/subdir/.hgsub mercurial-tests/testData/inc_patch_subrepo_with_excluding_checkout_rules/before/subdir/.hgsubstate mercurial-tests/testData/inc_patch_subrepo_with_excluding_checkout_rules/before/subdir/a
diffstat 47 files changed, 162 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/HgRepo.java	Mon Apr 15 16:53:47 2013 +0400
+++ b/mercurial-common/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/HgRepo.java	Tue Apr 16 16:20:30 2013 +0400
@@ -10,6 +10,7 @@
 import java.io.IOException;
 import java.util.*;
 
+import static java.util.Arrays.asList;
 import static java.util.Collections.emptyList;
 import static java.util.Collections.emptyMap;
 import static jetbrains.buildServer.buildTriggers.vcs.mercurial.HgFileUtil.deleteDir;
@@ -195,6 +196,10 @@
     return emptyList();
   }
 
+  public List<HgSubrepoConfigChange> getSubrepoConfigChanges(@NotNull String fromRevision, @NotNull String toRevision) {
+    return getSubrepoConfigChanges(toRevision, asList(fromRevision));
+  }
+
   public List<HgSubrepoConfigChange> getSubrepoConfigChanges(@NotNull String revision, @NotNull List<String> parentRevisions) {
     Map<String, SubRepo> curSubrepos = getSubrepositories(revision);
     List<Map<String, SubRepo>> prevSubrepos = new ArrayList<Map<String, SubRepo>>();
@@ -265,7 +270,7 @@
     cc.setRevId(revId);
     File catDir = null;
     try {
-      catDir = cc.execute(Arrays.asList(".hgsub", ".hgsubstate"), false);
+      catDir = cc.execute(asList(".hgsub", ".hgsubstate"), false);
       File hgsub = new File(catDir, ".hgsub");
       File hgsubstate = new File(catDir, ".hgsubstate");
       subrepos = readSubrepositories(hgsub, hgsubstate);
--- a/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java	Mon Apr 15 16:53:47 2013 +0400
+++ b/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java	Tue Apr 16 16:20:30 2013 +0400
@@ -60,6 +60,7 @@
   private final FileFilter myIgnoreDotHgFilter = new IgnoreDotHgFilter();
   private final FileFilter myAcceptAllFilter = new AcceptAllFilter();
   private final HgTestConnectionSupport myTestConnection;
+  private final SubrepoCheckoutRulesProvider mySubrepoCheckoutRulesProvider;
   private Collection<MercurialServerExtension> myExtensions;
 
   public MercurialVcsSupport(@NotNull final EventDispatcher<ServerListener> dispatcher,
@@ -69,13 +70,15 @@
                              @NotNull final RepoFactory repoFactory,
                              @NotNull final MirrorManager mirrorManager,
                              @NotNull final HgVcsRootFactory hgVcsRootFactory,
-                             @NotNull final HgTestConnectionSupport testConnection) {
+                             @NotNull final HgTestConnectionSupport testConnection,
+                             @NotNull final SubrepoCheckoutRulesProvider subrepoCheckoutRulesProvider) {
     myConfig = config;
     myMirrorManager = mirrorManager;
     myHgPathProvider = hgPathProvider;
     myRepoFactory = repoFactory;
     myHgVcsRootFactory = hgVcsRootFactory;
     myTestConnection = testConnection;
+    mySubrepoCheckoutRulesProvider = subrepoCheckoutRulesProvider;
     resetCacheHandlerManager.registerHandler(new MercurialResetCacheHandler(myMirrorManager));
     dispatcher.addListener(new ServerListenerAdapter() {
       @Override
@@ -248,11 +251,65 @@
           }
         }
       }
+      buildSubrepoPatch(root, fromVer, toVer, builder, checkoutRules, repo);
     } finally {
       deleteDir(parentDir, Loggers.VCS);
     }
   }
 
+
+  private void buildSubrepoPatch(@NotNull HgVcsRoot mainRoot,
+                                 @NotNull ChangeSet mainRootFromRevision,
+                                 @NotNull ChangeSet mainRootToRevision,
+                                 @NotNull PatchBuilder builder,
+                                 @NotNull CheckoutRules mainRootRules,
+                                 @NotNull HgRepo mainRepo) throws IOException, VcsException {
+    List<HgSubrepoConfigChange> subrepoConfigChanges = mainRepo.getSubrepoConfigChanges(mainRootFromRevision.getId(), mainRootToRevision.getId());
+    for (HgSubrepoConfigChange configChange : subrepoConfigChanges) {
+      try {
+        String subrepoPath = configChange.getPath();
+        if (!mainRootRules.shouldInclude(subrepoPath))
+          continue;
+        SubRepo currentSubrepo = configChange.getCurrent();
+
+        if (configChange.subrepoAdded()) {
+          assert currentSubrepo != null;
+          String subrepoUrl = currentSubrepo.resolveUrl(mainRoot.getRepository());
+          HgVcsRoot subrepoRoot = mainRoot.withUrl(subrepoUrl);
+          String subrepoFromRevision = null;
+          String subrepoToRevision = currentSubrepo.revision();
+          CheckoutRules subrepoRules = mySubrepoCheckoutRulesProvider.getSubrepoRules(mainRootRules, subrepoPath);
+          buildPatch(subrepoRoot, subrepoFromRevision, subrepoToRevision, builder, subrepoRules);
+
+        } else if (configChange.subrepoRemoved()) {
+          builder.deleteDirectory(new File(subrepoPath), true);
+
+        } else if (configChange.subrepoUrlChanged()) {
+          assert currentSubrepo != null;
+          builder.deleteDirectory(new File(subrepoPath), true);
+
+          String subrepoUrl = currentSubrepo.resolveUrl(mainRoot.getRepository());
+          HgVcsRoot subrepoRoot = mainRoot.withUrl(subrepoUrl);
+          String subrepoFromRevision = null;
+          String subrepoToRevision = currentSubrepo.revision();
+          CheckoutRules subrepoRules = mySubrepoCheckoutRulesProvider.getSubrepoRules(mainRootRules, subrepoPath);
+          buildPatch(subrepoRoot, subrepoFromRevision, subrepoToRevision, builder, subrepoRules);
+
+        } else {
+          assert currentSubrepo != null;
+          String subrepoUrl = currentSubrepo.resolveUrl(mainRoot.getRepository());
+          HgVcsRoot subrepoRoot = mainRoot.withUrl(subrepoUrl);
+          String subrepoFromRevision = configChange.getPrevious().get(0).revision();
+          String subrepoToRevision = currentSubrepo.revision();
+          CheckoutRules subrepoRules = mySubrepoCheckoutRulesProvider.getSubrepoRules(mainRootRules, subrepoPath);
+          buildPatch(subrepoRoot, subrepoFromRevision, subrepoToRevision, builder, subrepoRules);
+        }
+      } catch (URISyntaxException e) {
+        throw new VcsException("Error while resolving subrepo url", e);
+      }
+    }
+  }
+
   // builds patch by exporting files using specified version
   private void buildFullPatch(@NotNull final HgVcsRoot root,
                               @NotNull final ChangeSet toVer,
--- a/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialSupportBuilder.java	Mon Apr 15 16:53:47 2013 +0400
+++ b/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialSupportBuilder.java	Tue Apr 16 16:20:30 2013 +0400
@@ -8,6 +8,7 @@
 import jetbrains.buildServer.util.EventDispatcher;
 import jetbrains.buildServer.util.cache.ResetCacheHandler;
 import jetbrains.buildServer.util.cache.ResetCacheRegister;
+import jetbrains.buildServer.vcs.SubrepoCheckoutRulesProviderImpl;
 import jetbrains.buildServer.vcs.VcsManager;
 import org.jetbrains.annotations.NotNull;
 import org.jmock.Expectations;
@@ -46,7 +47,7 @@
       allowing(resetCacheManager).registerHandler(with(any(ResetCacheHandler.class)));
     }});
     MercurialVcsSupport vcs = new MercurialVcsSupport(dispatcher, resetCacheManager, myConfig, hgPathProvider,
-            repoFactory, mirrorManager, myHgRootFactory, testConnection);
+            repoFactory, mirrorManager, myHgRootFactory, testConnection, new SubrepoCheckoutRulesProviderImpl());
     vcs.setExtensions(myExtensions);
     return vcs;
   }
--- a/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/SubrepoPatchTest.java	Mon Apr 15 16:53:47 2013 +0400
+++ b/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/SubrepoPatchTest.java	Tue Apr 16 16:20:30 2013 +0400
@@ -3,6 +3,7 @@
 import com.intellij.openapi.diagnostic.Logger;
 import jetbrains.buildServer.log.Log4jFactory;
 import jetbrains.buildServer.vcs.CheckoutRules;
+import jetbrains.buildServer.vcs.VcsRoot;
 import jetbrains.buildServer.vcs.impl.VcsRootImpl;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
@@ -27,6 +28,7 @@
   private File myRemoteRepo2;
   private File myRemoteRepo3;
   private ServerPluginConfig myPluginConfig;
+  private VcsRoot myRoot;
 
   @BeforeMethod
   public void setUp() throws Exception {
@@ -43,6 +45,7 @@
             .detectSubrepoChanges(true)
             .build();
     myVcs = mercurialSupport().withConfig(myPluginConfig).build();
+    myRoot = vcsRoot().withUrl(myRemoteRepo1.getAbsolutePath()).withSubrepoChanges(true).build();
   }
 
   @Override
@@ -52,30 +55,62 @@
 
 
   public void clean_patch_should_use_subrepo_clones_on_the_server() throws Exception {
-    VcsRootImpl root = vcsRoot().withUrl(myRemoteRepo1.getAbsolutePath()).withSubrepoChanges(true).build();
-
-    //this makes plugin to clone r1 and its subrepos2
-    myVcs.getCollectChangesPolicy().collectChanges(root, "e4eced2b7381", "d64d9799c143", CheckoutRules.DEFAULT);
+    //this makes plugin to clone r1 and its subrepos
+    myVcs.getCollectChangesPolicy().collectChanges(myRoot, "e4eced2b7381", "d64d9799c143", CheckoutRules.DEFAULT);
 
     //delete remote subrepo to make sure patch is build from the clone on the server
     delete(myRemoteRepo3);
 
     setName("clean_patch_with_subrepositories");
-    checkPatchResult(buildPatch(myVcs, root, null, "d350e7209906", CheckoutRules.DEFAULT).toByteArray());
+    checkPatchResult(buildPatch(myVcs, myRoot, null, "d350e7209906", CheckoutRules.DEFAULT).toByteArray());
   }
 
 
   public void clean_patch_should_use_subrepo_clones_on_the_server_recursive_case() throws Exception {
-    VcsRootImpl root = vcsRoot().withUrl(myRemoteRepo1.getAbsolutePath()).withSubrepoChanges(true).build();
-
-    //this makes plugin to clone r1 and its subrepos2
-    myVcs.getCollectChangesPolicy().collectChanges(root, "e4eced2b7381", "d64d9799c143", CheckoutRules.DEFAULT);
+    //this makes plugin to clone r1 and its subrepos
+    myVcs.getCollectChangesPolicy().collectChanges(myRoot, "e4eced2b7381", "d64d9799c143", CheckoutRules.DEFAULT);
 
     //delete remote subrepos to make sure patch is build from the clone on the server
     delete(myRemoteRepo2);
     delete(myRemoteRepo3);
 
     setName("clean_patch_recursive_subrepos");
-    checkPatchResult(buildPatch(myVcs, root, null, "d64d9799c143", CheckoutRules.DEFAULT).toByteArray());
+    checkPatchResult(buildPatch(myVcs, myRoot, null, "d64d9799c143", CheckoutRules.DEFAULT).toByteArray());
+  }
+
+
+  public void incremental_patch_subrepo_revision_changed() throws Exception {
+    setName("inc_patch_subrepo_revision_changed");
+    checkPatchResult(buildPatch(myVcs, myRoot, "d350e7209906", "09c256b6163e", CheckoutRules.DEFAULT).toByteArray());
+  }
+
+
+  public void incremental_patch_subrepo_added() throws Exception {
+    setName("inc_patch_subrepo_added");
+    checkPatchResult(buildPatch(myVcs, myRoot, "4d7b3db8779f", "d350e7209906", CheckoutRules.DEFAULT).toByteArray());
+  }
+
+
+  public void incremental_patch_subrepo_removed() throws Exception {
+    setName("inc_patch_subrepo_removed");
+    checkPatchResult(buildPatch(myVcs, myRoot, "34017377d9c3", "4d7b3db8779f", CheckoutRules.DEFAULT).toByteArray());
+  }
+
+
+  public void incremental_patch_subrepo_url_changed() throws Exception {
+    setName("inc_patch_subrepo_url_changed");
+    checkPatchResult(buildPatch(myVcs, myRoot, "34017377d9c3", "d64d9799c143", CheckoutRules.DEFAULT).toByteArray());
+  }
+
+
+  public void incremental_patch_with_checkout_rules() throws Exception {
+    setName("inc_patch_subrepo_with_checkout_rules");
+    checkPatchResult(buildPatch(myVcs, myRoot, "d350e7209906", "09c256b6163e", new CheckoutRules("+:.=>subdir")).toByteArray());
+  }
+
+
+  public void incremental_patch_with_excluding_checkout_rules() throws Exception {
+    setName("inc_patch_subrepo_with_excluding_checkout_rules");
+    checkPatchResult(buildPatch(myVcs, myRoot, "d350e7209906", "09c256b6163e", new CheckoutRules("+:.=>subdir\n-:r2")).toByteArray());
   }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_added/after/.hgsub	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+r2 = ../r3
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_added/after/.hgsubstate	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+9e4a2fef1a1c04623a0d89edb4f3ba290cf2666e r2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_added/after/a	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_added/after/r2/c	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_added/before/a	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_removed/after/a	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_removed/before/.hgsub	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+r2 = ../r2
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_removed/before/.hgsubstate	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+916933c1dd8e89d38cfd6578b30b35fce867aa83 r2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_removed/before/a	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_removed/before/r2/b	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_revision_changed/after/.hgsub	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+r2 = ../r3
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_revision_changed/after/.hgsubstate	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+ebb884b1b691493d020a5590c1045b067188fe8a r2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_revision_changed/after/a	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_revision_changed/after/r2/c	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,3 @@
+c
+cc
+ccc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_revision_changed/before/.hgsub	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+r2 = ../r3
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_revision_changed/before/.hgsubstate	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+9e4a2fef1a1c04623a0d89edb4f3ba290cf2666e r2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_revision_changed/before/a	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_revision_changed/before/r2/c	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_url_changed/after/.hgsub	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+r2 = ../r3
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_url_changed/after/.hgsubstate	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+514c3e09cddf160486a96dedb196a39d9410972c r2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_url_changed/after/a	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_url_changed/after/r2/.hgsub	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+r2 = ../r2
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_url_changed/after/r2/.hgsubstate	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+ac0003deae69d799c0f86cb23585b32612de574d r2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_url_changed/after/r2/c	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,3 @@
+c
+cc
+ccc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_url_changed/after/r2/r2/b	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,3 @@
+b
+bb
+bbb
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_url_changed/before/.hgsub	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+r2 = ../r2
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_url_changed/before/.hgsubstate	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+916933c1dd8e89d38cfd6578b30b35fce867aa83 r2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_url_changed/before/a	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_url_changed/before/r2/b	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_with_checkout_rules/after/subdir/.hgsub	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+r2 = ../r3
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_with_checkout_rules/after/subdir/.hgsubstate	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+ebb884b1b691493d020a5590c1045b067188fe8a r2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_with_checkout_rules/after/subdir/a	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_with_checkout_rules/after/subdir/r2/c	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,3 @@
+c
+cc
+ccc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_with_checkout_rules/before/subdir/.hgsub	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+r2 = ../r3
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_with_checkout_rules/before/subdir/.hgsubstate	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+9e4a2fef1a1c04623a0d89edb4f3ba290cf2666e r2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_with_checkout_rules/before/subdir/a	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_with_checkout_rules/before/subdir/r2/c	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_with_excluding_checkout_rules/after/subdir/.hgsub	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+r2 = ../r3
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_with_excluding_checkout_rules/after/subdir/.hgsubstate	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+ebb884b1b691493d020a5590c1045b067188fe8a r2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_with_excluding_checkout_rules/after/subdir/a	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_with_excluding_checkout_rules/before/subdir/.hgsub	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+r2 = ../r3
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_with_excluding_checkout_rules/before/subdir/.hgsubstate	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+9e4a2fef1a1c04623a0d89edb4f3ba290cf2666e r2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial-tests/testData/inc_patch_subrepo_with_excluding_checkout_rules/before/subdir/a	Tue Apr 16 16:20:30 2013 +0400
@@ -0,0 +1,1 @@
+a