~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_source.py

  • Committer: John Arbash Meinel
  • Date: 2006-10-11 23:08:27 UTC
  • mto: This revision was merged to the branch mainline in revision 2080.
  • Revision ID: john@arbash-meinel.com-20061011230827-2bdfc45020695281
Change Copyright .. by Canonical to Copyright ... Canonical

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005 by Canonical Ltd
 
1
# Copyright (C) 2005 Canonical Ltd
2
2
#   Authors: Robert Collins <robert.collins@canonical.com>
3
3
#
4
4
# This program is free software; you can redistribute it and/or modify
152
152
        for fname, text in self.get_source_file_contents():
153
153
            if self.is_exception(fname):
154
154
                continue
155
 
            if not copyright_canonical_re.search(text):
156
 
                m = copyright_re.search(text)
157
 
                if m:
158
 
                    incorrect.append((fname, 'found: %s' % (m.group(),)))
 
155
            match = copyright_canonical_re.search(text)
 
156
            if not match:
 
157
                match = copyright_re.search(text)
 
158
                if match:
 
159
                    incorrect.append((fname, 'found: %s' % (match.group(),)))
159
160
                else:
160
161
                    incorrect.append((fname, 'no copyright line found\n'))
 
162
            else:
 
163
                if 'by Canonical' in match.group():
 
164
                    incorrect.append((fname,
 
165
                        'should not have: "by Canonical": %s'
 
166
                        % (match.group(),)))
161
167
 
162
168
        if incorrect:
163
169
            help_text = ["Some files have missing or incorrect copyright"