Rev 848: Merge 0.4. in file:///data/jelmer/bzr-svn/fileprops/
Jelmer Vernooij
jelmer at samba.org
Mon Jan 28 16:33:54 GMT 2008
At file:///data/jelmer/bzr-svn/fileprops/
------------------------------------------------------------
revno: 848
revision-id:jelmer at samba.org-20080128163352-ibfnfhp5q28rvhkv
parent: jelmer at samba.org-20080128163225-18tydulwmfdydvmp
parent: jelmer at samba.org-20080126012345-y24scghq8lvtgs5q
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: fileprops
timestamp: Mon 2008-01-28 17:33:52 +0100
message:
Merge 0.4.
added:
specs/revprops.txt revprops.txt-20080119124702-mrqj3lll8cpkpywc-1
renamed:
specs/revprop-commands.txt => specs/prop-commands.txt revpropcommands.txt-20080128163219-bsv7yvyplmst9h4y-1
modified:
FAQ faq-20070910195147-p9u38s9wplds2d4o-1
NEWS news-20061231030336-h9fhq245ie0de8bs-1
README README-20051120210643-bd274a2fef9aed6a
config.py config.py-20070624185721-0j8f1ly75uo4s1lk-1
convert.py svn2bzr.py-20051018015439-cb4563bff29e632d
mapping.txt mapping.txt-20060625151311-9ghaqrm71ajq593n-1
repository.py repository.py-20060306123302-1f8c5069b3fe0265
scheme.py scheme.py-20060516195850-95181aae6b272f9e
specs/unicode.txt unicode.txt-20080117193237-e9it2di8ed47svqo-1
tests/test_repos.py test_repos.py-20060508151940-ddc49a59257ca712
------------------------------------------------------------
revno: 845.1.10
revision-id:jelmer at samba.org-20080126012345-y24scghq8lvtgs5q
parent: jelmer at samba.org-20080125112949-i39tzky50bpiozge
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Sat 2008-01-26 02:23:45 +0100
message:
Warn about location when initializing Subversion repository cache.
modified:
NEWS news-20061231030336-h9fhq245ie0de8bs-1
repository.py repository.py-20060306123302-1f8c5069b3fe0265
------------------------------------------------------------
revno: 845.1.9
revision-id:jelmer at samba.org-20080125112949-i39tzky50bpiozge
parent: jelmer at samba.org-20080121163719-csrc1j32d20lkda8
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Fri 2008-01-25 12:29:49 +0100
message:
Add FAQ entry about push replacing branches.
modified:
FAQ faq-20070910195147-p9u38s9wplds2d4o-1
------------------------------------------------------------
revno: 845.1.8
revision-id:jelmer at samba.org-20080121163719-csrc1j32d20lkda8
parent: jelmer at samba.org-20080121150748-9zmkqxroe7losfz9
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Mon 2008-01-21 17:37:19 +0100
message:
Implement Repository.find_branches().
modified:
NEWS news-20061231030336-h9fhq245ie0de8bs-1
repository.py repository.py-20060306123302-1f8c5069b3fe0265
tests/test_repos.py test_repos.py-20060508151940-ddc49a59257ca712
------------------------------------------------------------
revno: 845.1.7
revision-id:jelmer at samba.org-20080121150748-9zmkqxroe7losfz9
parent: jelmer at samba.org-20080121055317-tp0oz2cgre9ofrl1
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Mon 2008-01-21 16:07:48 +0100
message:
Rename find_branches() -> find_branchpaths() because the first is also provided by super class Repository.
modified:
convert.py svn2bzr.py-20051018015439-cb4563bff29e632d
repository.py repository.py-20060306123302-1f8c5069b3fe0265
tests/test_repos.py test_repos.py-20060508151940-ddc49a59257ca712
------------------------------------------------------------
revno: 845.1.6
revision-id:jelmer at samba.org-20080121055317-tp0oz2cgre9ofrl1
parent: jelmer at samba.org-20080120135507-x2snexaglh79dyh8
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Mon 2008-01-21 06:53:17 +0100
message:
Handle corner case tracking branches.
modified:
NEWS news-20061231030336-h9fhq245ie0de8bs-1
repository.py repository.py-20060306123302-1f8c5069b3fe0265
------------------------------------------------------------
revno: 845.1.5
revision-id:jelmer at samba.org-20080120135507-x2snexaglh79dyh8
parent: jelmer at samba.org-20080119224310-tpio7v33kifakjj2
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Sun 2008-01-20 14:55:07 +0100
message:
Add extra assertions.
modified:
repository.py repository.py-20060306123302-1f8c5069b3fe0265
------------------------------------------------------------
revno: 845.1.4
revision-id:jelmer at samba.org-20080119224310-tpio7v33kifakjj2
parent: jelmer at samba.org-20080119204448-us00ep0zi8ekwwcf
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Sat 2008-01-19 23:43:10 +0100
message:
Add extra checks.
modified:
repository.py repository.py-20060306123302-1f8c5069b3fe0265
------------------------------------------------------------
revno: 845.1.3
revision-id:jelmer at samba.org-20080119204448-us00ep0zi8ekwwcf
parent: jelmer at samba.org-20080119195257-8ht40uy6xhhhxq2t
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Sat 2008-01-19 21:44:48 +0100
message:
Make sure scheme names are ascii strings.
modified:
config.py config.py-20070624185721-0j8f1ly75uo4s1lk-1
scheme.py scheme.py-20060516195850-95181aae6b272f9e
------------------------------------------------------------
revno: 845.1.2
revision-id:jelmer at samba.org-20080119195257-8ht40uy6xhhhxq2t
parent: jelmer at samba.org-20080119164115-of2i81i36f0xehjc
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Sat 2008-01-19 20:52:57 +0100
message:
Improve ReST formatting.
modified:
README README-20051120210643-bd274a2fef9aed6a
mapping.txt mapping.txt-20060625151311-9ghaqrm71ajq593n-1
specs/revprops.txt revprops.txt-20080119124702-mrqj3lll8cpkpywc-1
specs/unicode.txt unicode.txt-20080117193237-e9it2di8ed47svqo-1
------------------------------------------------------------
revno: 845.1.1
revision-id:jelmer at samba.org-20080119164115-of2i81i36f0xehjc
parent: jelmer at samba.org-20080118225921-r4y0rceu6pae58zt
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Sat 2008-01-19 17:41:15 +0100
message:
Initial work on a spec for revision property support.
added:
specs/revprops.txt revprops.txt-20080119124702-mrqj3lll8cpkpywc-1
=== modified file 'FAQ'
--- a/FAQ 2007-12-19 10:28:41 +0000
+++ b/FAQ 2008-01-25 11:29:49 +0000
@@ -103,3 +103,12 @@
bzr-svn does not create working trees by default. If you need
the working trees, run "bzr checkout" in the branch or
specify --trees to svn-import.
+
+=================================================================================
+bzr-svn did a replace operation when I tried to push a merge commit to Subversion
+=================================================================================
+Yes, this is because bzr-svn has to preserve the left-hand side history of your
+branch.
+
+If you would like to avoid this, use a checkout and merge into that ("bzr co") or
+rebase on trunk rather than merge it.
=== modified file 'NEWS'
--- a/NEWS 2008-01-18 22:59:21 +0000
+++ b/NEWS 2008-01-26 01:23:45 +0000
@@ -1,4 +1,10 @@
bzr-svn 0.4.7 UNRELEASED
+
+ FEATURES
+
+ * Implement Repository.find_branches(). (#178108)
+
+ * Warn about location when initializing Subversion repository cache.
BUGS
@@ -13,6 +19,8 @@
* Handle children of replaced directories, themselve replaced correctly. (#181790)
+ * Handle corner cases tracking branches. (#184457)
+
bzr-svn 0.4.6 2008-01-08
PERFORMANCE
=== modified file 'README'
--- a/README 2007-12-19 10:28:41 +0000
+++ b/README 2008-01-19 19:52:57 +0000
@@ -1,8 +1,10 @@
-#FORMAT rst
-
-============
+Bazaar support for Subversion branches, working trees and repositories
+======================================================================
+
+.. contents::
+
Introduction
-============
+------------
This directory contains a simple plugin that adds
Subversion (http://subversion.tigris.org/) branch support to
@@ -12,9 +14,8 @@
The plugin can at the moment be used to commit to, pull from, merge from, push
to and view logs of Subversion branches from Bazaar.
-============
Dependencies
-============
+------------
You will need at least version 0.92 of Bazaar or higher.
@@ -31,9 +32,8 @@
who used earlier versions of bzr-svn), you will need the bzr-rebase
plugin (http://bazaar-vcs.org/BzrSvn).
-========
Features
-========
+--------
The following features are currently present:
@@ -74,9 +74,8 @@
- Handles complex operations in Subversion: committing to two branches at
once, upgrading directories to branches, copies from early revisions, ...
-===================
Future Enhancements
-===================
+-------------------
In the future, I also hope to support:
@@ -136,18 +135,19 @@
Spec at https://launchpad.net/products/bzr/+spec/bzr-cpick-data
-====
Bugs
-====
+----
Please file bug reports in launchpad. The product URL for bzr-svn is
https://launchpad.net/products/bzr-svn/. The wiki for this
plugin is at http://bazaar-vcs.org/BzrSvn.
-============
Installation
-============
+------------
Simply place this directory in ~/.bazaar/plugins and you should be able
to check out branches from Subversion using bzr. Make sure the directory
name is 'svn'.
+
+..
+ vim: ft=rest
=== modified file 'config.py'
--- a/config.py 2007-10-30 22:08:13 +0000
+++ b/config.py 2008-01-19 20:44:48 +0000
@@ -63,7 +63,7 @@
"""
schemename = self._get_user_option("branching-scheme", use_global=False)
if schemename is not None:
- return BranchingScheme.find_scheme(schemename)
+ return BranchingScheme.find_scheme(schemename.encode('ascii'))
return None
def get_override_svn_revprops(self):
=== modified file 'convert.py'
--- a/convert.py 2007-11-02 14:23:06 +0000
+++ b/convert.py 2008-01-21 15:07:48 +0000
@@ -129,7 +129,7 @@
existing_branches = [(bp, revnum) for (bp, revnum, _) in
filter(filter_branch,
- source_repos.find_branches(source_repos.get_scheme()))]
+ source_repos.find_branchpaths(source_repos.get_scheme()))]
def is_dir((branch, revnum)):
return source_repos.transport.check_path(branch, revnum) == svn.core.svn_node_dir
=== modified file 'mapping.txt'
--- a/mapping.txt 2008-01-17 19:38:39 +0000
+++ b/mapping.txt 2008-01-19 19:52:57 +0000
@@ -223,3 +223,6 @@
"TREE_ROOT" and adds the file id map.
Revision 4 adds revision properties in addition to file properties.
+
+..
+ vim: ft=rest
=== modified file 'repository.py'
--- a/repository.py 2008-01-17 23:19:19 +0000
+++ b/repository.py 2008-01-26 01:23:45 +0000
@@ -16,8 +16,8 @@
"""Subversion repository access."""
import bzrlib
-from bzrlib import osutils, ui
-from bzrlib.branch import BranchCheckResult
+from bzrlib import osutils, ui, urlutils
+from bzrlib.branch import Branch, BranchCheckResult
from bzrlib.errors import (InvalidRevisionId, NoSuchRevision, NotBranchError,
UninitializableFormat, UnrelatedBranches)
from bzrlib.inventory import Inventory
@@ -26,7 +26,7 @@
from bzrlib.revisiontree import RevisionTree
from bzrlib.revision import Revision, NULL_REVISION
from bzrlib.transport import Transport, get_transport
-from bzrlib.trace import mutter
+from bzrlib.trace import info, mutter
from svn.core import SubversionException, Pool
import svn.core
@@ -295,6 +295,8 @@
cachedir_transport = get_transport(cache_dir)
cache_file = os.path.join(cache_dir, 'cache-v%d' % MAPPING_VERSION)
if not cachedbs.has_key(cache_file):
+ if not os.path.exists(cache_file):
+ info("Initialising Subversion metadata cache in %s" % cache_file)
cachedbs[cache_file] = sqlite3.connect(cache_file)
self.cachedb = cachedbs[cache_file]
@@ -771,9 +773,11 @@
# check again.
raise e
found = False
- for (branch, revno, _) in self.find_branches(scheme,
+ for (branch, revno, _) in self.find_branchpaths(scheme,
self.revmap.last_revnum_checked(str(scheme)),
last_revnum):
+ assert isinstance(branch, str)
+ assert isinstance(revno, int)
# Look at their bzr:revision-id-vX
revids = []
try:
@@ -1036,8 +1040,32 @@
return self._ancestry
- def find_branches(self, scheme, from_revnum=0, to_revnum=None):
- """Find all branches that were changed in the specified revision number.
+ def find_branches(self, using=False):
+ """Find branches underneath this repository.
+
+ This will include branches inside other branches.
+
+ :param using: If True, list only branches using this repository.
+ """
+ # All branches use this repository, so the using argument can be
+ # ignored.
+ scheme = self.get_scheme()
+
+ existing_branches = [bp for (bp, revnum, _) in
+ filter(lambda (bp, rev, exists): exists,
+ self.find_branchpaths(scheme))]
+
+ branches = []
+ for bp in existing_branches:
+ try:
+ branches.append(Branch.open(urlutils.join(self.base, bp)))
+ except NotBranchError: # Skip non-directories
+ pass
+ return branches
+
+ def find_branchpaths(self, scheme, from_revnum=0, to_revnum=None):
+ """Find all branch paths that were changed in the specified revision
+ range.
:param revnum: Revision to search for branches.
:return: iterator that returns tuples with (path, revision number, still exists). The revision number is the revision in which the branch last existed.
@@ -1059,9 +1087,16 @@
if scheme.is_branch(p) or scheme.is_tag(p):
if paths[p][0] in ('R', 'D') and p in created_branches:
del created_branches[p]
- j = self._log.find_latest_change(p, i-1,
- include_parents=True, include_children=True)
- ret.append((p, j, False))
+ if paths[p][1]:
+ prev_path = paths[p][1]
+ prev_rev = paths[p][2]
+ else:
+ prev_path = p
+ prev_rev = self._log.find_latest_change(p,
+ i-1, include_parents=True,
+ include_children=True)
+ assert isinstance(prev_rev, int)
+ ret.append((prev_path, prev_rev, False))
if paths[p][0] in ('A', 'R'):
created_branches[p] = i
@@ -1075,6 +1110,7 @@
j = self._log.find_latest_change(c, i-1,
include_parents=True,
include_children=True)
+ assert isinstance(j, int)
ret.append((c, j, False))
if paths[p][0] in ('A', 'R'):
parents = [p]
@@ -1099,6 +1135,7 @@
include_children=True)
if j is None:
j = created_branches[p]
+ assert isinstance(j, int)
ret.append((p, j, True))
return ret
=== modified file 'scheme.py'
--- a/scheme.py 2008-01-17 23:42:21 +0000
+++ b/scheme.py 2008-01-19 20:44:48 +0000
@@ -54,6 +54,7 @@
:param name: Name of branching scheme.
:return: Branching scheme instance.
"""
+ assert isinstance(name, str)
if name.startswith("trunk"):
if name == "trunk":
return TrunkBranchingScheme()
=== renamed file 'specs/revprop-commands.txt' => 'specs/prop-commands.txt'
=== added file 'specs/revprops.txt'
--- a/specs/revprops.txt 1970-01-01 00:00:00 +0000
+++ b/specs/revprops.txt 2008-01-19 19:52:57 +0000
@@ -0,0 +1,54 @@
+Revision properties
+===================
+
+.. contents:: :local:
+
+
+Motivation
+----------
+At the moment, Bazaar revision properties and metadata are stored in file properties on the
+branch root. Getting the revision properties for a series of revisions currently requires
+iterating over all of these revisions and calling svn_ls() on the branch root of the revision
+itself and the revision before that to obtain the properties set.
+
+This has several disadvantages:
+
+ - svn_ls() is quite expensive and slow
+ - file property changes are picked up by "svn diff" and commit notification
+ mailers. They should rather be ignored.
+ - they require you to know the branch root before being able to do anything
+
+Subversion custom revision property support
+-------------------------------------------
+Subversion supports storing custom revision properties. In older versions (pre 1.5), setting
+these revision properties is only possible after committing. This also requires
+the change of the revision property to be accepted by the pre-change-revprop hook, which
+is disabled by default.
+
+Subversion 1.5 allows setting custom revision properties as part of commit, without the
+need to change any hooks on the server side. It also supports iterating over custom
+revision properties using svn_ra_log().
+
+This should allow for a massive performance improvement and user experience. However,
+the problem is that this will not work with a lot of older Subversion repositories.
+
+Legacy repositories
+~~~~~~~~~~~~~~~~~~~
+- Set both file properties and revision properties unless support_legacy is set to False or the previous revision with revprops set didn't have file props set
+- Refuse to set revision properties unless all revisions since the last revision with bzr revision properties contain no bzr file props or contain both bzr file props and bzr revprops. When revprops are
+ seen, scan only for file properties since that point
+
+Upgrade command
+~~~~~~~~~~~~~~~
+`bzr svn-upgrade` needs to support being run on a Subversion repository or a
+new command should be added to allow setting matching revision properties for the existing
+file properties. This will iterate over the repository since the last revision with revprops set and
+set matching revision properties for each revision with file props.
+
+New settings
+~~~~~~~~~~~~
+A new per-Subversion-repository setting `support_legacy` will be added. This setting controls whether
+file properties should be set when pushing to the specified repository. It defaults to True.
+
+..
+ vim: ft=rest
=== modified file 'specs/unicode.txt'
--- a/specs/unicode.txt 2008-01-18 03:35:41 +0000
+++ b/specs/unicode.txt 2008-01-19 19:52:57 +0000
@@ -49,3 +49,6 @@
~~~~~~~~~~~~~
Bazaars working tree functions assume all relative paths are unicode,
so the same convention will be used for bzr-svn's working tree-related code.
+
+..
+ vim: ft=rest
=== modified file 'tests/test_repos.py'
--- a/tests/test_repos.py 2008-01-17 23:19:19 +0000
+++ b/tests/test_repos.py 2008-01-21 16:37:19 +0000
@@ -18,6 +18,7 @@
"""Subversion repository tests."""
+from bzrlib import urlutils
from bzrlib.branch import Branch
from bzrlib.bzrdir import BzrDir, format_registry
from bzrlib.config import GlobalConfig
@@ -280,7 +281,25 @@
self.assertEqual(1, len(list(repos.follow_branch_history("branches/brancha",
2, TrunkBranchingScheme()))))
- def test_find_branches_moved(self):
+ def test_find_branches(self):
+ repos_url = self.make_client("a", "dc")
+ self.build_tree({
+ 'dc/branches/brancha': None,
+ 'dc/branches/branchab': None,
+ 'dc/branches/brancha/data': "data",
+ "dc/branches/branchab/data":"data"})
+ self.client_add("dc/branches")
+ self.client_commit("dc", "My Message")
+ repos = Repository.open(repos_url)
+ repos.set_branching_scheme(TrunkBranchingScheme())
+ branches = repos.find_branches()
+ self.assertEquals(2, len(branches))
+ self.assertEquals(urlutils.join(repos.base, "branches/brancha"),
+ branches[0].base)
+ self.assertEquals(urlutils.join(repos.base, "branches/branchab"),
+ branches[1].base)
+
+ def test_find_branchpaths_moved(self):
repos_url = self.make_client("a", "dc")
self.build_tree({
'dc/tmp/branches/brancha': None,
@@ -297,9 +316,9 @@
self.assertEqual([("tags/branchab", 2, True),
("tags/brancha", 2, True)],
- list(repos.find_branches(TrunkBranchingScheme(), to_revnum=2)))
+ list(repos.find_branchpaths(TrunkBranchingScheme(), to_revnum=2)))
- def test_find_branches_start_revno(self):
+ def test_find_branchpaths_start_revno(self):
repos_url = self.make_client("a", "dc")
self.build_tree({'dc/branches/brancha': None})
self.client_add("dc/branches")
@@ -312,38 +331,38 @@
repos.set_branching_scheme(TrunkBranchingScheme())
self.assertEqual([("branches/branchb", 2, True)],
- list(repos.find_branches(TrunkBranchingScheme(), from_revnum=2,
+ list(repos.find_branchpaths(TrunkBranchingScheme(), from_revnum=2,
to_revnum=2)))
- def test_find_branches_file_moved_from_nobranch(self):
- repos_url = self.make_client("a", "dc")
- self.build_tree({
- 'dc/tmp/trunk': None,
- 'dc/bla/somefile': "contents"})
- self.client_add("dc/tmp")
- self.client_add("dc/bla")
- self.client_commit("dc", "My Message")
- self.client_copy("dc/bla", "dc/tmp/branches")
- self.client_delete("dc/tmp/branches/somefile")
- self.client_commit("dc", "My Message 2")
-
- Repository.open(repos_url).find_branches(TrunkBranchingScheme(2))
-
- def test_find_branches_deleted_from_nobranch(self):
- repos_url = self.make_client("a", "dc")
- self.build_tree({
- 'dc/tmp/trunk': None,
- 'dc/bla/somefile': "contents"})
- self.client_add("dc/tmp")
- self.client_add("dc/bla")
- self.client_commit("dc", "My Message")
- self.client_copy("dc/bla", "dc/tmp/branches")
- self.client_delete("dc/tmp/branches/somefile")
- self.client_commit("dc", "My Message 2")
-
- Repository.open(repos_url).find_branches(TrunkBranchingScheme(1))
-
- def test_find_branches_moved_nobranch(self):
+ def test_find_branchpaths_file_moved_from_nobranch(self):
+ repos_url = self.make_client("a", "dc")
+ self.build_tree({
+ 'dc/tmp/trunk': None,
+ 'dc/bla/somefile': "contents"})
+ self.client_add("dc/tmp")
+ self.client_add("dc/bla")
+ self.client_commit("dc", "My Message")
+ self.client_copy("dc/bla", "dc/tmp/branches")
+ self.client_delete("dc/tmp/branches/somefile")
+ self.client_commit("dc", "My Message 2")
+
+ Repository.open(repos_url).find_branchpaths(TrunkBranchingScheme(2))
+
+ def test_find_branchpaths_deleted_from_nobranch(self):
+ repos_url = self.make_client("a", "dc")
+ self.build_tree({
+ 'dc/tmp/trunk': None,
+ 'dc/bla/somefile': "contents"})
+ self.client_add("dc/tmp")
+ self.client_add("dc/bla")
+ self.client_commit("dc", "My Message")
+ self.client_copy("dc/bla", "dc/tmp/branches")
+ self.client_delete("dc/tmp/branches/somefile")
+ self.client_commit("dc", "My Message 2")
+
+ Repository.open(repos_url).find_branchpaths(TrunkBranchingScheme(1))
+
+ def test_find_branchpaths_moved_nobranch(self):
repos_url = self.make_client("a", "dc")
self.build_tree({
'dc/tmp/nested/foobar': None,
@@ -361,36 +380,36 @@
self.assertEqual([("t2/branches/brancha", 2, True),
("t2/branches/branchab", 2, True)],
- list(repos.find_branches(TrunkBranchingScheme(1), to_revnum=2)))
-
- def test_find_branches_no(self):
- repos_url = self.make_client("a", "dc")
-
- repos = Repository.open(repos_url)
- repos.set_branching_scheme(NoBranchingScheme())
-
- self.assertEqual([("", 0, True)],
- list(repos.find_branches(NoBranchingScheme(), to_revnum=0)))
-
- def test_find_branches_no_later(self):
- repos_url = self.make_client("a", "dc")
-
- repos = Repository.open(repos_url)
- repos.set_branching_scheme(NoBranchingScheme())
-
- self.assertEqual([("", 0, True)],
- list(repos.find_branches(NoBranchingScheme(), to_revnum=0)))
-
- def test_find_branches_trunk_empty(self):
+ list(repos.find_branchpaths(TrunkBranchingScheme(1), to_revnum=2)))
+
+ def test_find_branchpaths_no(self):
+ repos_url = self.make_client("a", "dc")
+
+ repos = Repository.open(repos_url)
+ repos.set_branching_scheme(NoBranchingScheme())
+
+ self.assertEqual([("", 0, True)],
+ list(repos.find_branchpaths(NoBranchingScheme(), to_revnum=0)))
+
+ def test_find_branchpaths_no_later(self):
+ repos_url = self.make_client("a", "dc")
+
+ repos = Repository.open(repos_url)
+ repos.set_branching_scheme(NoBranchingScheme())
+
+ self.assertEqual([("", 0, True)],
+ list(repos.find_branchpaths(NoBranchingScheme(), to_revnum=0)))
+
+ def test_find_branchpaths_trunk_empty(self):
repos_url = self.make_client("a", "dc")
repos = Repository.open(repos_url)
repos.set_branching_scheme(TrunkBranchingScheme())
self.assertEqual([],
- list(repos.find_branches(TrunkBranchingScheme(), to_revnum=0)))
+ list(repos.find_branchpaths(TrunkBranchingScheme(), to_revnum=0)))
- def test_find_branches_trunk_one(self):
+ def test_find_branchpaths_trunk_one(self):
repos_url = self.make_client("a", "dc")
repos = Repository.open(repos_url)
@@ -401,9 +420,9 @@
self.client_commit("dc", "My Message")
self.assertEqual([("trunk", 1, True)],
- list(repos.find_branches(TrunkBranchingScheme(), to_revnum=1)))
+ list(repos.find_branchpaths(TrunkBranchingScheme(), to_revnum=1)))
- def test_find_branches_removed(self):
+ def test_find_branchpaths_removed(self):
repos_url = self.make_client("a", "dc")
repos = Repository.open(repos_url)
@@ -417,9 +436,9 @@
self.client_commit("dc", "remove")
self.assertEqual([("trunk", 1, True)],
- list(repos.find_branches(TrunkBranchingScheme(), to_revnum=1)))
+ list(repos.find_branchpaths(TrunkBranchingScheme(), to_revnum=1)))
self.assertEqual([("trunk", 1, False)],
- list(repos.find_branches(TrunkBranchingScheme(), to_revnum=2)))
+ list(repos.find_branchpaths(TrunkBranchingScheme(), to_revnum=2)))
def test_url(self):
""" Test repository URL is kept """
More information about the bazaar-commits
mailing list