From 1208c663da17cf42efb478edf72ff690c7d3e9bf Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Wed, 21 Mar 2012 21:07:19 -0500 Subject: [PATCH] WIP on log-repos-root --- svn2svn/run/svn2svn.py | 7 +------ svn2svn/svnclient.py | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/svn2svn/run/svn2svn.py b/svn2svn/run/svn2svn.py index 54e7368..1267b48 100644 --- a/svn2svn/run/svn2svn.py +++ b/svn2svn/run/svn2svn.py @@ -764,12 +764,7 @@ def real_main(args, parser): # Get the first log entry at/after source_start_rev, which is where # we'll do the initial import from. source_ancestors = find_svn_ancestors(source_repos_url, source_base, source_end_rev, prefix=" ") - it_log_start = svnclient.iter_svn_log_entries(source_url, source_start_rev, source_end_rev, get_changed_paths=False, ancestors=source_ancestors) - source_start_log = None - for log_entry in it_log_start: - # Pick the first entry. Need to use a "for ..." loop since we're using an iterator. - source_start_log = log_entry - break + source_start_log = svnclient.get_first_svn_log_entry(source_url, source_start_rev, source_end_rev, get_changed_paths=False) if not source_start_log: raise InternalError("Unable to find any matching revisions between %s:%s in source_url: %s" % \ (source_start_rev, source_end_rev, source_url)) diff --git a/svn2svn/svnclient.py b/svn2svn/svnclient.py index efb3212..edc1788 100644 --- a/svn2svn/svnclient.py +++ b/svn2svn/svnclient.py @@ -356,13 +356,23 @@ def iter_svn_log_entries(svn_url, first_rev, last_rev, stop_on_copy=False, get_c start_t = time.time() stop_rev = min(last_rev, cur_rev + chunk_length) stop_rev = min(stop_rev, cur_anc_end_rev) if cur_anc_end_rev else stop_rev - entries = run_svn_log(cur_url, cur_rev, stop_rev, chunk_length, - stop_on_copy, get_changed_paths, get_revprops) + entries = run_svn_log(svn_repos_url, cur_rev, stop_rev, chunk_length, + stop_on_copy, True, get_revprops) duration = time.time() - start_t + cur_base = cur_url[len(svn_repos_url):] if entries: for e in entries: if e['revision'] > last_rev: break + # Manually do changed_paths checking + match = False + for d in e['changed_paths']: + path = d['path'] + if (path == cur_base) or (path.startswith(cur_base+"/")): + match = True + break + if not match: + continue # Embed the current URL in the yielded dict, for ancestor cases where # we might have followed a copy-from to some non-original URL. e['url'] = cur_url -- 2.45.2