~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_msgeditor.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-02-10 10:46:00 UTC
  • mfrom: (3996.1.1 ianc-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090210104600-o9xd7lm1d91067oj
Show all merged revisions in commit template (Colin Bennett)

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
  hell\u00d8
82
82
""")
83
83
 
 
84
    def make_multiple_pending_tree(self):
 
85
        from bzrlib import config
 
86
        config.GlobalConfig().set_user_option('email',
 
87
                                              'Bilbo Baggins <bb@hobbit.net>')
 
88
        tree = self.make_branch_and_tree('a')
 
89
        tree.commit('Initial checkin.', timestamp=1230912900, timezone=0)
 
90
        tree2 = tree.bzrdir.clone('b').open_workingtree()
 
91
        tree.commit('Minor tweak.', timestamp=1231977840, timezone=0)
 
92
        tree2.commit('Feature X work.', timestamp=1233186240, timezone=0)
 
93
        tree3 = tree2.bzrdir.clone('c').open_workingtree()
 
94
        tree2.commit('Feature X finished.', timestamp=1233187680, timezone=0)
 
95
        tree3.commit('Feature Y, based on initial X work.',
 
96
                     timestamp=1233285960, timezone=0)
 
97
        tree.merge_from_branch(tree2.branch)
 
98
        tree.merge_from_branch(tree3.branch)
 
99
        return tree
 
100
 
 
101
    def test_commit_template_pending_merges(self):
 
102
        """Test building a commit message template when there are pending
 
103
        merges.  The commit message should show all pending merge revisions,
 
104
        as does 'status -v', not only the merge tips.
 
105
        """
 
106
        working_tree = self.make_multiple_pending_tree()
 
107
        template = msgeditor.make_commit_message_template(working_tree, None)
 
108
        self.assertEqualDiff(template,
 
109
u"""\
 
110
pending merges:
 
111
  Bilbo Baggins 2009-01-29 Feature X finished.
 
112
    Bilbo Baggins 2009-01-28 Feature X work.
 
113
  Bilbo Baggins 2009-01-30 Feature Y, based on initial X work.
 
114
""")
 
115
 
84
116
    def test_commit_template_encoded(self):
85
117
        """Test building a commit message template"""
86
118
        working_tree = self.make_uncommitted_tree()