~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to fai/cmdutil.py

  • Committer: Robert Collins
  • Date: 2005-09-13 11:20:11 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-20050913112010-ffd55901ae7f0791
determine version-0 ancestors from a tree when possible

Show diffs side-by-side

added added

removed removed

Lines of Context:
1136
1136
        except pybaz.errors.ExecProblem:
1137
1137
            # baz does not know
1138
1138
            # guess
1139
 
            ancestor = namespace_previous(log.revision)
 
1139
            if log.revision.patchlevel != 'version-0': 
 
1140
                ancestor = namespace_previous(log.revision)
 
1141
            else:
 
1142
                found = False
 
1143
                ancestor = None
 
1144
                # ancestor might be in the tree
 
1145
                for tree_log in pybaz.WorkingTree(log.tree).iter_logs(
 
1146
                    log.revision.version, reverse=True):
 
1147
                    if found:
 
1148
                        ancestor = tree_log.revision
 
1149
                        break
 
1150
                    if tree_log.revision == log.revision:
 
1151
                        found = True
 
1152
                print "ancestor of %s is %s" % (log.revision, ancestor)
1140
1153
        if ancestor is not None:
1141
1154
            indirect.append(ancestor)
1142
1155
    return [log for log in logs if not log.revision in indirect]
1151
1164
        return revision.version['patch-%d' % level]
1152
1165
    if revision.patchlevel == 'version-0':
1153
1166
        raise RuntimeError("cannot determine prior namespace level for a "
1154
 
                           "version-0 patch")
 
1167
                           "version-0 patch ('%s')" % revision)
1155
1168
    if revision.patchlevel == 'version-1':
1156
1169
        return revision.version['version-0']
1157
1170
    if revision.patchlevel.startswith('version'):