[PATCH 1 of 2] regression test for issue1552

Benjamin Pollack benjamin at bitquabit.com
Tue Mar 17 10:53:26 CDT 2009


# HG changeset patch
# User Benjamin Pollack <benjamin at bitquabit.com>
# Date 1237304080 14400
# Node ID 85397d58c070b08a0fd40b9f012580c6fecf0ff8
# Parent  55bd03e2e13c65eeb7175abfc60f9a6ef5e6f0f4
regression test for issue1552

Ensures that fetch correctly infers what to merge when pulling a
repository with inactive branches.

diff --git a/tests/test-fetch b/tests/test-fetch
--- a/tests/test-fetch
+++ b/tests/test-fetch
@@ -170,6 +170,21 @@
 hg -R n2 parents --template '{rev}\n'
 rm -fr n1 n2
 
+echo % test fetch with inactive branches
+hg init ib1
+echo a > ib1/a
+hg --cwd ib1 ci -Am base
+hg --cwd ib1 branch second
+echo b > ib1/b
+hg --cwd ib1 ci -Am onsecond
+hg --cwd ib1 branch -f default
+echo c > ib1/c
+hg --cwd ib1 ci -Am newdefault
+hg clone ib1 ib2
+echo % fetch should succeed
+hg --cwd ib2 fetch ../ib1
+rm -fr ib1 ib2
+
 "$TESTDIR/killdaemons.py"
 
 true
diff --git a/tests/test-fetch.out b/tests/test-fetch.out
--- a/tests/test-fetch.out
+++ b/tests/test-fetch.out
@@ -178,3 +178,15 @@
 abort: working dir not at branch tip (use "hg update" to check out branch tip)
 % parent should be 0 (fetch did not update or merge anything)
 0
+% test fetch with inactive branches
+adding a
+marked working directory as branch second
+adding b
+marked working directory as branch default
+adding c
+updating working directory
+3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+% fetch should succeed
+pulling from ../ib1
+searching for changes
+no changes found


More information about the Mercurial-devel mailing list