~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revision.py

  • Committer: Robert Collins
  • Date: 2010-05-06 23:41:35 UTC
  • mto: This revision was merged to the branch mainline in revision 5223.
  • Revision ID: robertc@robertcollins.net-20100506234135-yivbzczw1sejxnxc
Lock methods on ``Tree``, ``Branch`` and ``Repository`` are now
expected to return an object which can be used to unlock them. This reduces
duplicate code when using cleanups. The previous 'tokens's returned by
``Branch.lock_write`` and ``Repository.lock_write`` are now attributes
on the result of the lock_write. ``repository.RepositoryWriteLockResult``
and ``branch.BranchWriteLockResult`` document this. (Robert Collins)

``log._get_info_for_log_files`` now takes an add_cleanup callable.
(Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2005-2010 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
28
28
    symbol_versioning,
29
29
    )
30
30
from bzrlib.osutils import contains_whitespace
31
 
from bzrlib.progress import DummyProgress
32
31
 
33
32
NULL_REVISION="null:"
34
33
CURRENT_REVISION="current:"
54
53
 
55
54
    def __init__(self, revision_id, properties=None, **args):
56
55
        self.revision_id = revision_id
57
 
        self.properties = properties or {}
58
 
        self._check_properties()
 
56
        if properties is None:
 
57
            self.properties = {}
 
58
        else:
 
59
            self.properties = properties
 
60
            self._check_properties()
59
61
        self.committer = None
60
62
        self.parent_ids = []
61
63
        self.parent_sha1s = []
88
90
                raise ValueError("invalid property name %r" % name)
89
91
            if not isinstance(value, basestring):
90
92
                raise ValueError("invalid property value %r for %r" %
91
 
                                 (name, value))
 
93
                                 (value, name))
92
94
 
93
95
    def get_history(self, repository):
94
96
        """Return the canonical line-of-history for this revision.