Rev 2229: Add specific tests for push -d and pull -d in file:///home/mbp/bzr/Work/tags/
Martin Pool
mbp at sourcefrog.net
Wed Jan 24 05:09:56 GMT 2007
------------------------------------------------------------
revno: 2229
revision-id: mbp at sourcefrog.net-20070124050955-q7fed1sy7ddc78ui
parent: mbp at sourcefrog.net-20070121124213-8ksq92nrm3tzn6s9
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: tags
timestamp: Wed 2007-01-24 16:09:55 +1100
message:
Add specific tests for push -d and pull -d
modified:
bzrlib/tests/blackbox/test_pull.py test_pull.py-20051201144907-64959364f629947f
bzrlib/tests/blackbox/test_push.py test_push.py-20060329002750-929af230d5d22663
=== modified file 'bzrlib/tests/blackbox/test_pull.py'
--- a/bzrlib/tests/blackbox/test_pull.py 2006-10-11 23:08:27 +0000
+++ b/bzrlib/tests/blackbox/test_pull.py 2007-01-24 05:09:55 +0000
@@ -1,5 +1,4 @@
-# Copyright (C) 2005 Canonical Ltd
-# -*- coding: utf-8 -*-
+# Copyright (C) 2005, 2006 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -24,6 +23,7 @@
from bzrlib.branch import Branch
from bzrlib.tests.blackbox import ExternalBase
from bzrlib.uncommit import uncommit
+from bzrlib import urlutils
class TestPull(ExternalBase):
@@ -96,6 +96,19 @@
self.runbzr('pull ../b')
self.runbzr('pull ../b')
+ def test_pull_dash_d(self):
+ os.mkdir('a')
+ os.chdir('a')
+ self.example_branch()
+ self.runbzr('init ../b')
+ self.runbzr('init ../c')
+ # pull into that branch
+ self.runbzr('pull -d ../b .')
+ # pull into a branch specified by a url
+ c_url = urlutils.local_path_to_url('../c')
+ self.assertStartsWith(c_url, 'file://')
+ self.runbzr('pull -d %s .' % c_url)
+
def test_pull_revision(self):
"""Pull some changes from one branch to another."""
os.mkdir('a')
=== modified file 'bzrlib/tests/blackbox/test_push.py'
--- a/bzrlib/tests/blackbox/test_push.py 2006-10-16 01:25:46 +0000
+++ b/bzrlib/tests/blackbox/test_push.py 2007-01-24 05:09:55 +0000
@@ -1,5 +1,4 @@
-# Copyright (C) 2005 Canonical Ltd
-# -*- coding: utf-8 -*-
+# Copyright (C) 2005, 2007 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -20,7 +19,9 @@
import os
-import bzrlib
+from bzrlib import (
+ urlutils,
+ )
from bzrlib.branch import Branch
from bzrlib.bzrdir import BzrDirMetaFormat1
from bzrlib.osutils import abspath
@@ -97,7 +98,7 @@
out, err = self.run_bzr('push', 'pushed-location')
self.assertEqual('', out)
self.assertEqual('0 revision(s) pushed.\n', err)
- b2 = bzrlib.branch.Branch.open('pushed-location')
+ b2 = Branch.open('pushed-location')
self.assertEndsWith(b2.base, 'pushed-location/')
def test_push_new_branch_revision_count(self):
@@ -160,3 +161,13 @@
t.add('filename', 'funky-chars<>%&;"\'')
t.commit('commit filename')
self.run_bzr('push', '../new-tree')
+
+ def test_push_dash_d(self):
+ t = self.make_branch_and_tree('from')
+ t.commit(allow_pointless=True,
+ message='first commit')
+ self.runbzr('push -d from to-one')
+ self.failUnlessExists('to-one')
+ self.runbzr('push -d %s %s'
+ % tuple(map(urlutils.local_path_to_url, ['from', 'to-two'])))
+ self.failUnlessExists('to-two')
More information about the bazaar-commits
mailing list