~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to fai/cmdutil.py

  • Committer: Robert Collins
  • Date: 2005-09-13 10:46:27 UTC
  • mto: (147.2.6) (364.1.3 bzrtools)
  • mto: This revision was merged to the branch mainline in revision 324.
  • Revision ID: robertc@robertcollins.net-20050913104627-51f938950a907475
handle inaccessible sibling archives somewhat - note version-0 is still not handled

Show diffs side-by-side

added added

removed removed

Lines of Context:
1127
1127
        return []
1128
1128
    for log in logs:
1129
1129
        indirect.extend([f for f in log.new_patches if f != log.revision])
1130
 
        ancestor = log.revision.ancestor
1131
 
        if ancestor is not None:
1132
 
            indirect.append(log.revision.ancestor)
 
1130
        if log.continuation_of is not None:
 
1131
            # continuations list everything in new_patches
 
1132
            continue
 
1133
        try:
 
1134
            # ask baz if we can
 
1135
            ancestor = log.revision.ancestor
 
1136
        except pybaz.errors.ExecProblem:
 
1137
            # baz does not know
 
1138
            # guess
 
1139
            ancestor = namespace_previous(log.revision)
 
1140
        if ancestor is not None and ancestor != '<<<no previous revision>>>':
 
1141
            indirect.append(ancestor)
1133
1142
    return [log for log in logs if not log.revision in indirect]
1134
1143
 
 
1144
def namespace_previous(revision):
 
1145
    if revision.patchlevel == 'patch-1':
 
1146
        return revision.version['base-0']
 
1147
    if revision.patchlevel.startswith('patch'):
 
1148
        level = int(revision.patchlevel[len('patch-'):]) -1
 
1149
        return revision.version['patch-%d' % level]
 
1150
    if revision.patchlevel == 'version-0':
 
1151
        raise RuntimeError("cannot determine prior namespace level for a "
 
1152
                           "version-0 patch")
 
1153
    if revision.patchlevel == 'version-1':
 
1154
        return revision.version['version-0']
 
1155
    print pybaz.NameParser
1135
1156
 
1136
1157
def require_version_exists(version, spec):
1137
1158
    if not version.exists():