~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_repository.py

  • Committer: Martin Pool
  • Date: 2007-01-16 13:21:38 UTC
  • mto: (2220.2.19 tags)
  • mto: This revision was merged to the branch mainline in revision 2309.
  • Revision ID: mbp@sourcefrog.net-20070116132138-vhziz9hpfc8za0uj
Add tag command and basic implementation

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006 Canonical Ltd
 
1
# Copyright (C) 2006, 2007 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
321
321
        self.assertTrue(S_ISDIR(t.stat('knits').st_mode))
322
322
        self.check_knits(t)
323
323
 
324
 
 
325
324
class InterString(repository.InterRepository):
326
325
    """An inter-repository optimised code path for strings.
327
326
 
458
457
        tree.commit("Another dull commit", rev_id='dull2')
459
458
        revision_tree = tree.branch.repository.revision_tree('dull2')
460
459
        self.assertEqual('dull', revision_tree.inventory.root.revision)
 
460
 
 
461
    def test_tag_serialization(self):
 
462
        """Test the precise representation of tag dicts."""
 
463
        # Don't change this after we commit to this format, as it checks 
 
464
        # that the format is stable and compatible across releases
 
465
        format = repository.RepositoryFormatKnit2()
 
466
        td = dict(stable='stable-revid', boring='boring-revid')
 
467
        packed = format._serialize_tag_dict(td)
 
468
        expected = 'boring\tboring-revid\nstable\tstable-revid\n'
 
469
        self.assertEqualDiff(packed, expected)
 
470
        self.assertEqual(format._deserialize_tag_dict(packed), td)
 
471