~jelmer/ubuntu/maverick/bzr/proposed-2.2.3

« back to all changes in this revision

Viewing changes to contrib/newinventory.py

  • Committer: Bazaar Package Importer
  • Author(s): Steinar H. Gunderson
  • Date: 2006-11-08 01:28:55 UTC
  • mfrom: (1.1.15 upstream) (3.1.14 edgy)
  • Revision ID: james.westby@ubuntu.com-20061108012855-faugrhqdxr3cuu9o
Tags: 0.11-1.1
* Non-maintainer upload.
* In test_osutils.py, sort what we get from os.listdir() before checking it;
  the OS can give back directory entries in whatever order it likes, and
  this shouldn't break the tests. Fixes intermittent test failures and
  FTBFS. (Closes: #395203)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# (C) 2005 Canonical Ltd
2
 
 
 
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
5
5
# the Free Software Foundation; either version 2 of the License, or
6
6
# (at your option) any later version.
7
 
 
 
7
#
8
8
# This program is distributed in the hope that it will be useful,
9
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
11
# GNU General Public License for more details.
12
 
 
 
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
35
35
                el.set('text_id', ie.text_id)
36
36
            if ie.text_sha1:
37
37
                el.set('text_sha1', ie.text_sha1)
38
 
            if ie.text_size != None:
 
38
            if ie.text_size is not None:
39
39
                el.set('text_size', ('%d' % ie.text_size))
40
40
        elif kind != 'directory':
41
41
            raise BzrError('unknown InventoryEntry kind %r' % kind)
84
84
                f.write('text_id="%s" ' % ie.text_id)
85
85
            if ie.text_sha1:
86
86
                f.write('text_sha1="%s" ' % ie.text_sha1)
87
 
            if ie.text_size != None:
 
87
            if ie.text_size is not None:
88
88
                f.write('text_size="%d" ' % ie.text_size)
89
89
            f.write('/>\n')
90
90
        elif kind == 'directory':