~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:49:57 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-20050913104956-b218148d6ac663b3
handle version-xxx and base-0 correctly in namespace_previous

Show diffs side-by-side

added added

removed removed

Lines of Context:
1137
1137
            # baz does not know
1138
1138
            # guess
1139
1139
            ancestor = namespace_previous(log.revision)
1140
 
        if ancestor is not None and ancestor != '<<<no previous revision>>>':
 
1140
        if ancestor is not None:
1141
1141
            indirect.append(ancestor)
1142
1142
    return [log for log in logs if not log.revision in indirect]
1143
1143
 
1144
1144
def namespace_previous(revision):
 
1145
    if revision.patchlevel == 'base-0':
 
1146
        return None
1145
1147
    if revision.patchlevel == 'patch-1':
1146
1148
        return revision.version['base-0']
1147
1149
    if revision.patchlevel.startswith('patch'):
1152
1154
                           "version-0 patch")
1153
1155
    if revision.patchlevel == 'version-1':
1154
1156
        return revision.version['version-0']
1155
 
    print pybaz.NameParser
 
1157
    if revision.patchlevel.startswith('version'):
 
1158
        level = int(revision.patchlevel[len('version-'):]) -1
 
1159
        return revision.version['version-%d' % level]
 
1160
    raise NotImplementedError
1156
1161
 
1157
1162
def require_version_exists(version, spec):
1158
1163
    if not version.exists():