tests/test-default-push
author Sean Meiners <sean.meiners@linspire.com>
Fri, 30 Jun 2006 19:24:02 -0700
changeset 2549 e1831f06eef1
parent 2496 6dbb8ae0a0b3
permissions -rwxr-xr-x
Added ability to clone from a local repository to a (new) remote one. Rearranged the clone command a good bit to make sure it validates that the source does exist and that the destination doesn't before doing anything. Before I moved the source repo check it would create the destination repository before it verified the source existed. Moved the responsibility for creating the destination repo root directory entirly into the localrepo class so that local to local cloning doesn't break. This also simplifies the code a bit since it's no longer being done in both clone and init. Changed the names of the 'repo' and 'other' variables to 'dest_repo' and 'src_repo' to maintain my sanity. Passes 82/83 tests. The only failure is the version number test, which I suspect is supposed to fail since it comes from a generated file.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2496
6dbb8ae0a0b3 add test for default-push.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     1
#!/bin/sh
6dbb8ae0a0b3 add test for default-push.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     2
6dbb8ae0a0b3 add test for default-push.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     3
hg init a
6dbb8ae0a0b3 add test for default-push.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     4
echo a > a/a
6dbb8ae0a0b3 add test for default-push.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     5
hg --cwd a ci -Ama
6dbb8ae0a0b3 add test for default-push.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     6
6dbb8ae0a0b3 add test for default-push.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     7
hg clone a c
6dbb8ae0a0b3 add test for default-push.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     8
6dbb8ae0a0b3 add test for default-push.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
     9
hg clone a b
6dbb8ae0a0b3 add test for default-push.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    10
echo b >> b/a
6dbb8ae0a0b3 add test for default-push.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    11
hg --cwd b ci -mb
6dbb8ae0a0b3 add test for default-push.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    12
6dbb8ae0a0b3 add test for default-push.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    13
echo % push should push to default when default-push not set
6dbb8ae0a0b3 add test for default-push.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    14
hg --cwd b push | sed 's/pushing to.*/pushing/'
6dbb8ae0a0b3 add test for default-push.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    15
6dbb8ae0a0b3 add test for default-push.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    16
echo % push should push to default-push when set
6dbb8ae0a0b3 add test for default-push.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    17
echo 'default-push = ../c' >> b/.hg/hgrc
6dbb8ae0a0b3 add test for default-push.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    18
hg --cwd b push | sed 's/pushing to.*/pushing/'