/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 bzrlib/lockdir.py

  • Committer: Andrew Bennetts
  • Date: 2009-12-03 05:57:41 UTC
  • mfrom: (4857 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4869.
  • Revision ID: andrew.bennetts@canonical.com-20091203055741-vmmg0fmjgjw2pwvu
MergeĀ lp:bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007, 2008 Canonical Ltd
 
1
# Copyright (C) 2006, 2007, 2008, 2009 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
110
110
    debug,
111
111
    errors,
112
112
    lock,
 
113
    osutils,
113
114
    )
114
115
import bzrlib.config
115
116
from bzrlib.decorators import only_raises
416
417
 
417
418
        peek() reads the info file of the lock holder, if any.
418
419
        """
419
 
        return self._parse_info(self.transport.get(path))
 
420
        return self._parse_info(self.transport.get_bytes(path))
420
421
 
421
422
    def peek(self):
422
423
        """Check if the lock is held by anyone.
449
450
                   )
450
451
        return s.to_string()
451
452
 
452
 
    def _parse_info(self, info_file):
453
 
        return rio.read_stanza(info_file.readlines()).as_dict()
 
453
    def _parse_info(self, info_bytes):
 
454
        # TODO: Handle if info_bytes is empty
 
455
        return rio.read_stanza(osutils.split_lines(info_bytes)).as_dict()
454
456
 
455
457
    def attempt_lock(self):
456
458
        """Take the lock; fail if it's already held.