/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: 2018-02-18 21:42:57 UTC
  • mto: This revision was merged to the branch mainline in revision 6859.
  • Revision ID: jelmer@jelmer.uk-20180218214257-jpevutp1wa30tz3v
Update TODO to reference Breezy, not Bazaar.

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
 
17
19
from ... import (
18
20
    controldir,
19
21
    commands,
30
32
    takes_options = ['directory']
31
33
 
32
34
    def run(self, file_id, rev_id, directory=u'.'):
33
 
        file_id = file_id.encode()
34
 
        rev_id = rev_id.encode()
 
35
        file_id = file_id.decode('ascii')
 
36
        rev_id = rev_id.decode('ascii')
35
37
        bd, relpath = controldir.ControlDir.open_containing(directory)
36
38
        repo = bd.find_repository()
37
39
        self.add_cleanup(repo.lock_read().unlock)
40
42
        # print len(all_invs)
41
43
        for inv in repo.iter_inventories(all_invs, 'unordered'):
42
44
            try:
43
 
                entry = inv.get_entry(file_id)
 
45
                entry = inv[file_id]
44
46
            except errors.NoSuchId:
45
47
                # This file doesn't even appear in this inv.
46
48
                continue
47
49
            if entry.revision == rev_id:
48
 
                self.outf.write(inv.revision_id + b'\n')
 
50
                self.outf.write(inv.revision_id + '\n')