Rev 2118: Fix the build. in http://people.samba.org/bzr/jelmer/bzr-svn/0.5
Jelmer Vernooij
jelmer at samba.org
Mon Dec 1 01:26:03 GMT 2008
At http://people.samba.org/bzr/jelmer/bzr-svn/0.5
------------------------------------------------------------
revno: 2118
revision-id: jelmer at samba.org-20081201012556-b4xiuqofnqe2qupu
parent: jelmer at samba.org-20081130234127-xdyy1l6z8feg5tka
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.5
timestamp: Mon 2008-12-01 02:25:56 +0100
message:
Fix the build.
modified:
commit.py commit.py-20060607190346-qvq128wgfubhhgm2-1
convert.py svn2bzr.py-20051018015439-cb4563bff29e632d
fetch.py fetch.py-20060625004942-x2lfaib8ra707a8p-1
revmeta.py revmeta.py-20080901215045-n8a6arqybs9ez5hl-1
tests/test_fetch.py test_fetch.py-20070624210302-luvgwjmlfysk5qeq-1
workingtree.py workingtree.py-20060306120941-b083cb0fdd4a69de
=== modified file 'commit.py'
--- a/commit.py 2008-11-21 16:13:14 +0000
+++ b/commit.py 2008-12-01 01:25:56 +0000
@@ -649,8 +649,8 @@
revprops=self._svn_revprops,
changed_fileprops=self._changed_fileprops,
fileprops=self._svnprops,
- metabranch=None # FIXME: Determine from base_revmeta ?
)
+ self.revmeta._set_direct_lhs_parent_revmeta(self._base_revmeta)
revid = self.revmeta.get_revision_id(self.base_mapping)
=== modified file 'convert.py'
--- a/convert.py 2008-11-30 23:27:28 +0000
+++ b/convert.py 2008-12-01 01:25:56 +0000
@@ -253,8 +253,11 @@
pb = ui.ui_factory.nested_progress_bar()
try:
for i, source_branch in enumerate(existing_branches):
- pb.update("%s:%d" % (source_branch.get_branch_path(),
- source_branch.get_revnum()), i, len(existing_branches))
+ try:
+ pb.update("%s:%d" % (source_branch.get_branch_path(),
+ source_branch.get_revnum()), i, len(existing_branches))
+ except SubversionException, (_, ERR_FS_NOT_DIRECTORY):
+ continue
target_dir = get_dir(source_branch.get_branch_path())
if not create_shared_repo:
try:
=== modified file 'fetch.py'
--- a/fetch.py 2008-11-30 19:56:48 +0000
+++ b/fetch.py 2008-12-01 01:25:56 +0000
@@ -737,7 +737,7 @@
while len(extra) > 0:
foreign_revid, project, mapping = extra.pop()
- needed += check_revid(foreign_revid, mapping, project)
+ needed.extend(check_revid(foreign_revid, mapping, project))
return needed
@@ -823,7 +823,10 @@
self._prev_inv = None
for num, (revmeta, mapping) in enumerate(revs):
- revid = revmeta.get_revision_id(mapping)
+ try:
+ revid = revmeta.get_revision_id(mapping)
+ except SubversionException, (_, ERR_FS_NOT_DIRECTORY):
+ continue
assert revid != NULL_REVISION
if pb is not None:
pb.update('copying revision', num, len(revs))
@@ -904,6 +907,8 @@
if nested_pb is not None:
nested_pb.finished()
finally:
+ if self.target.is_in_write_group():
+ self.target.abort_write_group()
self.target.unlock()
def _fetch_revision_chunks(self, revs, pb=None):
=== modified file 'revmeta.py'
--- a/revmeta.py 2008-11-30 23:41:27 +0000
+++ b/revmeta.py 2008-12-01 01:25:56 +0000
@@ -107,9 +107,7 @@
def __eq__(self, other):
return (type(self) == type(other) and
- self.branch_path == other.branch_path and
- self.revnum == other.revnum and
- self.uuid == other.uuid)
+ self.get_foreign_revid() == other.get_foreign_revid())
def __repr__(self):
return "<RevisionMetadata for revision %d, path %s in repository %r>" % (self.revnum, self.branch_path, self.uuid)
@@ -226,10 +224,13 @@
return self._changed_fileprops
def _set_direct_lhs_parent_revmeta(self, parent_revmeta):
- assert (not self._direct_lhs_parent_known or
- self._direct_lhs_parent_revmeta == parent_revmeta)
+ if (self._direct_lhs_parent_known and
+ self._direct_lhs_parent_revmeta != parent_revmeta):
+ raise AssertionError()
self._direct_lhs_parent_known = True
self._direct_lhs_parent_revmeta = parent_revmeta
+ if parent_revmeta is not None:
+ parent_revmeta.children.add(self)
def get_direct_lhs_parent_revmeta(self):
"""Find the direct left hand side parent of this revision.
@@ -238,14 +239,15 @@
"""
if self._direct_lhs_parent_known:
return self._direct_lhs_parent_revmeta
- self._direct_lhs_parent_known = True
if self.metaiterator is not None:
# Perhaps the metaiterator already has the parent?
try:
self._direct_lhs_parent_revmeta = self.metaiterator.get_lhs_parent(self)
+ self._direct_lhs_parent_known = True
return self._direct_lhs_parent_revmeta
except StopIteration:
self._direct_lhs_parent_revmeta = None
+ self._direct_lhs_parent_known = True
return self._direct_lhs_parent_revmeta
except MetaHistoryIncomplete:
pass
@@ -258,6 +260,7 @@
self._direct_lhs_parent_revmeta = iterator.next()
except StopIteration:
self._direct_lhs_parent_revmeta = None
+ self._direct_lhs_parent_known = True
return self._direct_lhs_parent_revmeta
def get_lhs_parent_revmeta(self, mapping):
@@ -679,7 +682,10 @@
try:
self.next()
except StopIteration:
- raise AssertionError("This should never occur")
+ if self.to_revnum > 0:
+ raise MetaHistoryIncomplete()
+ raise AssertionError("Unable to find direct lhs parent for %r" % revmeta)
+ return revmeta._direct_lhs_parent_revmeta
def fetch_until(self, revnum):
"""Fetch at least all revisions until revnum."""
@@ -688,16 +694,9 @@
self.next()
except StopIteration:
return
- except MetaHistoryIncomplete:
- return
def next(self):
- try:
- ret = self._iter.next()
- except StopIteration:
- if self.to_revnum > 0:
- raise MetaHistoryIncomplete()
- raise
+ ret = self._iter.next()
self._actions.append(ret)
return ret
@@ -708,13 +707,13 @@
def process_new_rev(bp, mb, revnum, paths, revprops):
revmeta = self._provider.get_revision(bp, revnum, paths, revprops,
metaiterator=self)
+ assert revmeta is not None
children = set([c._revs[-1] for c in metabranches_history[revnum][bp]])
if mb._revs:
children.add(mb._revs[-1])
mb.append(revmeta)
for c in children:
c._set_direct_lhs_parent_revmeta(revmeta)
- revmeta.children.update(children)
return revmeta
unusual = set()
@@ -726,7 +725,9 @@
pb.update("discovering revisions", revnum-self.to_revnum,
self.from_revnum-self.to_revnum)
- self._metabranches.update([(k, iter(v).next()) for (k, v) in metabranches_history[revnum].iteritems()])
+ for bp, mbs in metabranches_history[revnum].iteritems():
+ if not bp in self._metabranches:
+ self._metabranches[bp] = iter(mbs).next()
unusual.update(unusual_history[revnum])
for p in sorted(paths):
@@ -740,7 +741,7 @@
if action != 'D' or ip != "":
bps[bp] = self._metabranches[bp]
for u in unusual:
- if p.startswith("%s/" % u):
+ if (p == u and not action in ('D', 'R')) or p.startswith("%s/" % u):
bps[u] = self._metabranches[u]
if action in ('R', 'D') and (
self.layout.is_branch_or_tag(p, project) or
@@ -759,28 +760,23 @@
if old_name is None:
# didn't exist previously
if new_name in self._metabranches:
- self._metabranches[new_name]._set_direct_lhs_parent_revmeta(None)
+ if self._metabranches[new_name]._revs:
+ self._metabranches[new_name]._revs[-1]._set_direct_lhs_parent_revmeta(None)
del self._metabranches[new_name]
else:
data = self._metabranches[new_name]
del self._metabranches[new_name]
- if data._revs:
- metabranches_history[old_rev][old_name].add(data)
+ metabranches_history[old_rev][old_name].add(data)
if not self.layout.is_branch_or_tag(old_name, project):
unusual_history[old_rev].add(old_name)
for bp, mb in bps.items():
revmeta = process_new_rev(bp, mb, revnum, paths, revprops)
+ if (bp in paths and paths[bp][0] in ('A', 'R') and
+ paths[bp][1] is None):
+ revmeta._set_direct_lhs_parent_revmeta(None)
yield "revision", revmeta
self._last_revnum = revnum
- del metabranches_history[revnum]
-
- # Make sure commit 0 is processed
- if self.to_revnum == 0 and self.layout.is_branch_or_tag("", project):
- revmeta = process_new_rev("", self._metabranches[""], 0, changes.REV0_CHANGES, {})
- self._metabranches[""]._set_direct_lhs_parent_revmeta(None)
- yield "revision", revmeta
- self._last_revnum = 0
def filter_revisions(it):
@@ -904,7 +900,7 @@
ret = self.get_revision(bp, revnum, paths, revprops,
metaiterator=metabranch)
if metabranch._revs:
- ret.children.add(metabranch._revs[-1])
+ metabranch._revs[-1]._set_direct_lhs_parent_revmeta(ret)
metabranch.append(ret)
return ret
metabranch = RevisionMetadataBranch(self, limit)
=== modified file 'tests/test_fetch.py'
--- a/tests/test_fetch.py 2008-11-18 04:23:14 +0000
+++ b/tests/test_fetch.py 2008-12-01 01:25:56 +0000
@@ -60,28 +60,28 @@
ch.add_dir("trunk/check/debian")
ch.add_file("trunk/check/stamp-h.in").modify("foo")
dc.add_dir("tags")
- dc.close()
+ dc.close() #1
dc = self.get_commit_editor(repos_url)
t = dc.open_dir("trunk")
ch = t.open_dir("trunk/check")
deb = ch.open_dir("trunk/check/debian")
deb.add_file("trunk/check/debian/pl").modify("bar")
- dc.close()
+ dc.close() #2
dc = self.get_commit_editor(repos_url)
t = dc.open_dir("trunk")
ch = t.open_dir("trunk/check")
deb = ch.open_dir("trunk/check/debian")
deb.add_file("trunk/check/debian/voo").modify("bar")
- dc.close()
+ dc.close() #3
dc = self.get_commit_editor(repos_url)
t = dc.open_dir("trunk")
ch = t.open_dir("trunk/check")
deb = ch.open_dir("trunk/check/debian")
deb.add_file("trunk/check/debian/blie").modify("oeh")
- dc.close()
+ dc.close() #4
dc = self.get_commit_editor(repos_url)
t = dc.open_dir("trunk")
@@ -89,7 +89,7 @@
deb = ch.open_dir("trunk/check/debian")
deb.add_file("trunk/check/debian/bar").modify("oeh")
ch.add_file("trunk/check/bar").modify("bla")
- dc.close()
+ dc.close() #5
self.make_checkout(repos_url, "dc")
self.client_copy("dc/trunk", "dc/tags/R_0_9_2", revnum=2)
@@ -102,7 +102,7 @@
revnum=4)
self.build_tree({"dc/tags/R_0_9_2/check/debian/blie": "oehha"})
self.client_update("dc")
- self.client_commit("dc", "strange revision")
+ self.client_commit("dc", "strange revision") # 6
oldrepos = Repository.open(repos_url)
oldrepos.set_layout(TrunkLayout(0))
dir = BzrDir.create("f", format.get_rich_root_format())
=== modified file 'workingtree.py'
--- a/workingtree.py 2008-11-30 22:17:51 +0000
+++ b/workingtree.py 2008-12-01 01:25:56 +0000
@@ -48,6 +48,7 @@
from bzrlib.transport import get_transport
from bzrlib.workingtree import WorkingTree, WorkingTreeFormat
+from collections import defaultdict
import os
import urllib
More information about the bazaar-commits
mailing list