~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to fai.py

  • Committer: Robert Collins
  • Date: 2006-04-24 01:35:08 UTC
  • mto: (364.1.3 bzrtools)
  • mto: This revision was merged to the branch mainline in revision 366.
  • Revision ID: robertc@robertcollins.net-20060424013508-2d37e47814d9493e
Support importing into empty branches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
def direct_merges(merges, excludes=[]):
26
26
    """Get a list of direct merges, from a list of direct and indirect
27
 
 
 
27
    
28
28
    :param merges: Iterator of merge patchlogs
29
29
    :type merges: iter of `pybaz.Patchlog`
30
30
    :return: The direct merges
36
36
        return []
37
37
    for log in logs:
38
38
        try:
39
 
            this_indirect = set([str(f) for f in log.new_patches
40
 
                                 if f != log.revision and
 
39
            if log['New-patches'] is None:
 
40
                import pdb;pdb.set_trace()
 
41
            this_indirect = set([str(f) for f in log.new_patches 
 
42
                                 if f != log.revision and 
41
43
                                     str(f) not in indirect])
42
44
        except pybaz.errors.NamespaceError:
43
45
            print
44
46
            print "log ", log, " unusable, attempting to use archive copy."
45
47
            log = pybaz.Revision(str(log.revision)).patchlog
46
 
            this_indirect = set([str(f) for f in log.new_patches
47
 
                                 if f != log.revision and
 
48
            this_indirect = set([str(f) for f in log.new_patches 
 
49
                                 if f != log.revision and 
48
50
                                     str(f) not in indirect])
49
51
        indirect.update(this_indirect)
50
52
        if log.continuation_of is not None:
56
58
        except pybaz.errors.ExecProblem:
57
59
            # baz does not know
58
60
            # guess
59
 
            if log.revision.patchlevel != 'version-0':
 
61
            if log.revision.patchlevel != 'version-0': 
60
62
                ancestor = namespace_previous(log.revision)
61
63
            else:
62
64
                found = False
123
125
    :rtype: Iterator of str
124
126
    """
125
127
    args = [ 'new-merges', '--dir', directory ]
126
 
    if reverse:
 
128
    if reverse: 
127
129
        args.append('--reverse')
128
130
    args.append(version)
129
131
    return sequence_cmd(args)