-#!/usr/bin/env python2.4
-#
# Copyright (C) 2005-2006 by Jelmer Vernooij
#
# This program is free software; you can redistribute it and/or modify
transport.mkdir(relpath)
needed.pop()
except NoSuchFile:
+ if relpath == "":
+ raise
needed.append((transport, urlutils.dirname(relpath)))
if create_shared_repo:
try:
target_repos = get_dir("").open_repository()
- assert scheme.is_branch("") or target_repos.is_shared()
+ assert scheme.is_branch("") or scheme.is_tag("") or target_repos.is_shared()
except NoRepositoryPresent:
target_repos = get_dir("").create_repository(shared=True)
target_repos.set_make_working_trees(working_trees)
target_branch = target_dir.create_branch()
if not revid in target_branch.revision_history():
source_branch = Branch.open(urlutils.join(url, branch))
+ # Check if target_branch contains a subset of
+ # source_branch. If that is not the case,
+ # assume that source_branch has been replaced
+ # and remove target_branch
+ if not target_branch.last_revision() in \
+ source_branch.revision_history():
+ target_branch.set_revision_history([])
+
target_branch.pull(source_branch)
if working_trees and not target_dir.has_workingtree():
target_dir.create_workingtree()