~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/commands.py

  • Committer: John Arbash Meinel
  • Date: 2008-08-25 21:50:11 UTC
  • mfrom: (0.11.3 tools)
  • mto: This revision was merged to the branch mainline in revision 3659.
  • Revision ID: john@arbash-meinel.com-20080825215011-de9esmzgkue3e522
Merge in Lukáš's helper scripts.
Update the packaging documents to describe how to do the releases
using bzr-builddeb to package all distro platforms
simultaneously.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
            bundle_info = read_bundle(bundle_file)
60
60
        else:
61
61
            if verbose:
62
 
                raise errors.BzrCommandError('Verbose requires a merge'
63
 
                                             ' directive')
 
62
                raise errors.BzrCommandError('--verbose requires a merge'
 
63
                    ' directive')
64
64
        reader_method = getattr(bundle_info, 'get_bundle_reader', None)
65
65
        if reader_method is None:
66
66
            raise errors.BzrCommandError('Bundle format not supported')
73
73
                (bytes, parents, repo_kind, revision_id, file_id))
74
74
            if file_id is not None:
75
75
                file_ids.add(file_id)
76
 
        print >> self.outf, 'Records'
 
76
        self.outf.write('Records\n')
77
77
        for kind, records in sorted(by_kind.iteritems()):
78
78
            multiparent = sum(1 for b, m, k, r, f in records if
79
79
                              len(m.get('parents', [])) > 1)
80
 
            print >> self.outf, '%s: %d (%d multiparent)' % \
81
 
                (kind, len(records), multiparent)
82
 
        print >> self.outf, 'unique files: %d' % len(file_ids)
83
 
        print >> self.outf
 
80
            self.outf.write('%s: %d (%d multiparent)\n' % \
 
81
                (kind, len(records), multiparent))
 
82
        self.outf.write('unique files: %d\n' % len(file_ids))
 
83
        self.outf.write('\n')
84
84
        nicks = set()
85
85
        committers = set()
86
86
        for revision in bundle_info.real_revisions:
88
88
                nicks.add(revision.properties['branch-nick'])
89
89
            committers.add(revision.committer)
90
90
 
91
 
        print >> self.outf, 'Revisions'
92
 
        print >> self.outf, ('nicks: %s'
93
 
            % ', '.join(sorted(nicks))).encode(term_encoding, 'replace')
94
 
        print >> self.outf, ('committers: \n%s' %
95
 
        '\n'.join(sorted(committers)).encode(term_encoding, 'replace'))
 
91
        self.outf.write('Revisions\n')
 
92
        self.outf.write(('nicks: %s\n'
 
93
            % ', '.join(sorted(nicks))).encode(term_encoding, 'replace'))
 
94
        self.outf.write(('committers: \n%s\n' %
 
95
        '\n'.join(sorted(committers)).encode(term_encoding, 'replace')))
96
96
        if verbose:
97
 
            print >> self.outf
 
97
            self.outf.write('\n')
98
98
            bundle_file.seek(0)
99
99
            line = bundle_file.readline()
100
100
            line = bundle_file.readline()
101
101
            content = bundle_file.read().decode('bz2')
102
 
            print >> self.outf, "Decoded contents"
 
102
            self.outf.write("Decoded contents\n")
103
103
            self.outf.write(content)
104
 
            print >> self.outf
 
104
            self.outf.write('\n')