# HG changeset patch # User Dan Villiom Podlaski Christiansen # Date 1375908131 -7200 # Node ID 36fe4b316a6b973161b3d623b19174dca31243ea # Parent 67e11b650e9465d23f860f7caf341a72d8f33186 stupid: fix --startrev we didn't test for this, so it was broken... diff --git a/hgsubversion/stupid.py b/hgsubversion/stupid.py --- a/hgsubversion/stupid.py +++ b/hgsubversion/stupid.py @@ -606,12 +606,18 @@ def checkbranch(meta, r, branch): return None return branchtip -def branches_in_paths(meta, tbdelta, paths, revnum, checkpath, listdir): +def branches_in_paths(meta, tbdelta, paths, revnum, checkpath, listdir, + firstrun): '''Given a list of paths, return mapping of all branches touched to their branch path. ''' branches = {} - paths_need_discovery = [] + if firstrun: + paths_need_discovery = [p for (p, t) in listdir('', revnum) + if t == 'f'] + else: + paths_need_discovery = [] + for p in paths: relpath, branch, branchpath = meta.split_branch_path(p) if relpath is not None: @@ -671,7 +677,7 @@ def convert_rev(ui, meta, svn, r, tbdelt raise hgutil.Abort('filemaps currently unsupported with stupid replay.') branches = branches_in_paths(meta, tbdelta, r.paths, r.revnum, - svn.checkpath, svn.list_files) + svn.checkpath, svn.list_files, firstrun) brpaths = branches.values() bad_branch_paths = {} for br, bp in branches.iteritems(): @@ -735,7 +741,8 @@ def convert_rev(ui, meta, svn, r, tbdelt # it, or we can force the existing fetch_branchrev() path. Do # the latter for now. incremental = (meta.revmap.oldest > 0 and - parentctx.rev() != node.nullrev) + parentctx.rev() != node.nullrev and + not firstrun) if incremental: try: diff --git a/tests/comprehensive/test_verify_and_startrev.py b/tests/comprehensive/test_verify_and_startrev.py --- a/tests/comprehensive/test_verify_and_startrev.py +++ b/tests/comprehensive/test_verify_and_startrev.py @@ -104,9 +104,7 @@ for case in fixtures: attrs[name] = buildmethod(case, name, True, 'standard') name = bname + '_single' attrs[name] = buildmethod(case, name, False, 'single') - # Disabled because the "stupid and real are the same" tests - # verify this plus even more. - # name = bname + '_single_stupid' - # attrs[name] = buildmethod(case, name, True, 'single') + name = bname + '_single_stupid' + attrs[name] = buildmethod(case, name, True, 'single') VerifyTests = type('VerifyTests', (test_util.TestBase,), attrs)