# HG changeset patch # User Marcin Kasperski # Date 1474726070 -7200 # Node ID f371747bb8fc456480e62a1b31cfd9b703d6150a # Parent cf3fe04cd96b89c707108fe06223ecc489e549e8 Improving basic tests diff -r cf3fe04cd96b -r f371747bb8fc tests/basic.t --- a/tests/basic.t Sat Sep 24 15:51:58 2016 +0200 +++ b/tests/basic.t Sat Sep 24 16:07:50 2016 +0200 @@ -21,7 +21,7 @@ > [ui] > username = Andy Default > [extensions] - > all_paths = + > mercurial_all_paths = > EOF We need some repositories to test. @@ -31,7 +31,7 @@ $ hg init "$REP2" $ hg init "$REP3" - $ cat > $BASE/.hg/hgrc + $ cat > $BASE/.hg/hgrc << EOF > [paths] > remote1=$REP1 > remote2=$REP2 @@ -40,36 +40,61 @@ Let's test pushing - $ echo > $BASE/file.txt + $ cat > $BASE/file.txt << EOF > Some text > EOF $ hg --cwd $BASE add + adding file.txt $ hg --cwd $BASE commit -m 'First' - $ hg --cwd $BASE pushall - - $ hg --cwd $REP1 log + $ hg --cwd $BASE pushal + pushing to */rep1 (glob) + searching for changes + adding changesets + adding manifests + adding file changes + added 1 changesets with 1 changes to 1 files + pushing to */rep2 (glob) + searching for changes + adding changesets + adding manifests + adding file changes + added 1 changesets with 1 changes to 1 files + pushing to */rep3 (glob) + searching for changes + adding changesets + adding manifests + adding file changes + added 1 changesets with 1 changes to 1 files - $ hg --cwd $REP2 log - - $ hg --cwd $REP3 log + $ hg --cwd $REP1 log -T '{rev}: {desc}\n' + 0: First + + $ hg --cwd $REP2 log -T '{rev}: {desc}\n' + 0: First + + $ hg --cwd $REP3 log -T '{rev}: {desc}\n' + 0: First Let's also test pulling $ hg --cwd $REP1 update + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved - $ echo > $REP1/rep1.txt + $ cat > $REP1/rep1.txt << EOF > Another text > EOF $ hg --cwd $REP1 add + adding rep1.txt $ hg --cwd $REP1 commit -m "In repo1" $ hg --cwd $REP2 update + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved - $ echo >> $REP2/file.txt + $ cat >> $REP2/file.txt << EOF > From repo2… > EOF @@ -77,44 +102,158 @@ $ hg --cwd $REP2 commit -m "In repo2" $ hg --cwd $BASE incomingall + comparing with */rep1 (glob) + searching for changes + changeset: 1:* (glob) + tag: tip + user: Andy Default + date: .* (re) + summary: In repo1 + + comparing with */rep2 (glob) + searching for changes + changeset: 1:* (glob) + tag: tip + user: Andy Default + date: .* (re) + summary: In repo2 + + comparing with */rep3 (glob) + searching for changes + no changes found $ hg --cwd $BASE pullall + pulling from */rep1 (glob) + searching for changes + adding changesets + adding manifests + adding file changes + added 1 changesets with 1 changes to 1 files + (run 'hg update' to get a working copy) + pulling from */rep2 (glob) + searching for changes + adding changesets + adding manifests + adding file changes + added 1 changesets with 1 changes to 1 files (+1 heads) + (run 'hg heads' to see heads, 'hg merge' to merge) + pulling from */rep3 (glob) + searching for changes + no changes found - $ hg --cwd $BASE log + $ hg --cwd $BASE log -T '{rev}: {desc}\n' + 2: In repo2 + 1: In repo1 + 0: First $ hg --cwd $BASE outgoingall + comparing with */rep1 (glob) + searching for changes + changeset: 2:af9f142e6a2b + tag: tip + parent: 0:3fd54094234f + user: Andy Default + date: Sat Sep 24 14:00:35 2016 +0000 + summary: In repo2 + + comparing with */rep2 (glob) + searching for changes + changeset: 1:ad3792f1ee79 + user: Andy Default + date: Sat Sep 24 14:00:35 2016 +0000 + summary: In repo1 + + comparing with */rep3 (glob) + searching for changes + changeset: 1:ad3792f1ee79 + user: Andy Default + date: Sat Sep 24 14:00:35 2016 +0000 + summary: In repo1 + + changeset: 2:af9f142e6a2b + tag: tip + parent: 0:3fd54094234f + user: Andy Default + date: Sat Sep 24 14:00:35 2016 +0000 + summary: In repo2 Without remotes those commands do nothing $ hg --cwd $REP3 pullall + abort: No paths defined in section paths + [255] $ hg --cwd $REP3 pushall + abort: No paths defined in section paths + [255] $ hg --cwd $REP3 incomingall + abort: No paths defined in section paths + [255] $ hg --cwd $REP3 outgoingall + abort: No paths defined in section paths + [255] Finally let's test that push options work - $ echo > $BASE/br1.txt + $ cat > $BASE/br1.txt << EOF > Br1 text > EOF $ hg --cwd $BASE branch br1 + marked working directory as branch br1 + (branches are permanent and global, did you want a bookmark?) $ hg --cwd $BASE add + adding br1.txt $ hg --cwd $BASE commit -m 'Br1' $ hg --cwd $BASE update default - $ echo >> $BASE/file.txt + $ cat >> $BASE/file.txt << EOF > later text > EOF - $ hg --cwd $BASE commit -m 'Normal'' + $ hg --cwd $BASE commit -m 'Normal' $ hg --cwd $BASE pushall -r default -f - - $ hg --cwd $REP1 log + pushing to */rep1 (glob) + searching for changes + adding changesets + adding manifests + adding file changes + added 2 changesets with 2 changes to 1 files (+1 heads) + pushing to */rep2 (glob) + searching for changes + adding changesets + adding manifests + adding file changes + added 1 changesets with 1 changes to 1 files + pushing to */rep3 (glob) + searching for changes + adding changesets + adding manifests + adding file changes + added 2 changesets with 2 changes to 1 files - $ hg --cwd $REP2 log - - $ hg --cwd $REP3 log + $ hg --cwd $BASE log -T '{rev}: {desc}\n' + 4: Normal + 3: Br1 + 2: In repo2 + 1: In repo1 + 0: First + $ hg --cwd $REP1 log -T '{rev}: {desc}\n' + 3: Normal + 2: In repo2 + 1: In repo1 + 0: First + + $ hg --cwd $REP2 log -T '{rev}: {desc}\n' + 2: Normal + 1: In repo2 + 0: First + + $ hg --cwd $REP3 log -T '{rev}: {desc}\n' + 2: Normal + 1: In repo2 + 0: First +