~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/testament.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:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
"""Testament - a summary of a revision for signing.
18
18
 
19
 
A testament can be defined as "something that serves as tangible
 
19
A testament can be defined as "something that serves as tangible 
20
20
proof or evidence."  In bzr we use them to allow people to certify
21
 
particular revisions as authentic.
 
21
particular revisions as authentic.  
22
22
 
23
23
The goal is that if two revisions are semantically equal, then they will
24
24
have a byte-for-byte equal testament.  We can define different versions of
61
61
 
62
62
# XXX: At the moment, clients trust that the graph described in a weave
63
63
# is accurate, but that's not covered by the testament.  Perhaps the best
64
 
# fix is when verifying a revision to make sure that every file mentioned
 
64
# fix is when verifying a revision to make sure that every file mentioned 
65
65
# in the revision has compatible ancestry links.
66
66
 
67
67
# TODO: perhaps write timestamp in a more readable form
70
70
# revisions can be serialized.
71
71
 
72
72
from copy import copy
 
73
from sha import sha
73
74
 
74
 
from bzrlib.osutils import (
75
 
    contains_whitespace,
76
 
    contains_linebreaks,
77
 
    sha,
78
 
    )
 
75
from bzrlib.osutils import contains_whitespace, contains_linebreaks
79
76
 
80
77
 
81
78
class Testament(object):
82
79
    """Reduced summary of a revision.
83
80
 
84
 
    Testaments can be
 
81
    Testaments can be 
85
82
 
86
83
      - produced from a revision
87
84
      - written to a stream
180
177
 
181
178
    def as_short_text(self):
182
179
        """Return short digest-based testament."""
183
 
        return (self.short_header +
 
180
        return (self.short_header + 
184
181
                'revision-id: %s\n'
185
182
                'sha1: %s\n'
186
183
                % (self.revision_id, self.as_sha1()))
218
215
 
219
216
class StrictTestament3(StrictTestament):
220
217
    """This testament format is for use as a checksum in bundle format 0.9+
221
 
 
 
218
    
222
219
    It differs from StrictTestament by including data about the tree root.
223
220
    """
224
221