~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to obsolete/annotate.py

  • Committer: Aaron Bentley
  • Date: 2007-08-16 03:30:21 UTC
  • mto: This revision was merged to the branch mainline in revision 576.
  • Revision ID: aaron.bentley@utoronto.ca-20070816033021-e9k6t6rj25ndlhrk
Allow zap --force to delete modified checkouts

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
    def run(self, filename):
68
68
        if not os.path.exists(filename):
69
69
            raise BzrCommandError("The file %s does not exist." % filename)
70
 
        branch = (Branch.open_containing(filename))
71
 
        file_id = branch.working_tree().path2id(branch.relpath(filename))
 
70
        branch,relpath = (Branch.open_containing(filename))
 
71
        file_id = branch.working_tree().path2id(relpath)
72
72
        if file_id is None:
73
73
            raise BzrCommandError("The file %s is not versioned." % filename)
74
74
        lines = branch.basis_tree().get_file(file_id)
97
97
class CantGetRevisionData(Exception):
98
98
    def __init__(self, revision):
99
99
        Exception.__init__(self, "Can't get data for revision %s" % revision)
100
 
        
 
100
 
101
101
def annotate_file2(file_lines, anno_iter):
102
102
    for result in iter_annotate_file(file_lines, anno_iter):
103
103
        pass
104
104
    return result
105
105
 
106
 
        
 
106
 
107
107
def iter_annotate_file(file_lines, anno_iter):
108
108
    lines = [AnnotateLine(f) for f in file_lines]
109
109
    patches = []
118
118
 
119
119
                for cur_patch in patches:
120
120
                    num = cur_patch.pos_in_mod(num)
121
 
                    if num == None: 
 
121
                    if num == None:
122
122
                        break
123
123
 
124
124
                if num >= len(lines):