/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/plugins/repodebug/file_refs.py

  • Committer: Jelmer Vernooij
  • Date: 2020-03-22 01:35:14 UTC
  • mfrom: (7490.7.6 work)
  • mto: This revision was merged to the branch mainline in revision 7499.
  • Revision ID: jelmer@jelmer.uk-20200322013514-7vw1ntwho04rcuj3
merge lp:brz/3.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
from __future__ import absolute_import
18
 
 
19
17
from ... import (
20
18
    controldir,
21
19
    commands,
32
30
    takes_options = ['directory']
33
31
 
34
32
    def run(self, file_id, rev_id, directory=u'.'):
35
 
        file_id = file_id.decode('ascii')
36
 
        rev_id = rev_id.decode('ascii')
 
33
        file_id = file_id.encode()
 
34
        rev_id = rev_id.encode()
37
35
        bd, relpath = controldir.ControlDir.open_containing(directory)
38
36
        repo = bd.find_repository()
39
37
        self.add_cleanup(repo.lock_read().unlock)
42
40
        # print len(all_invs)
43
41
        for inv in repo.iter_inventories(all_invs, 'unordered'):
44
42
            try:
45
 
                entry = inv[file_id]
 
43
                entry = inv.get_entry(file_id)
46
44
            except errors.NoSuchId:
47
45
                # This file doesn't even appear in this inv.
48
46
                continue
49
47
            if entry.revision == rev_id:
50
 
                self.outf.write(inv.revision_id + '\n')
 
48
                self.outf.write(inv.revision_id + b'\n')