~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_trace.py

  • Committer: Vincent Ladeuil
  • Date: 2009-07-02 13:07:14 UTC
  • mto: (4524.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4525.
  • Revision ID: v.ladeuil+lp@free.fr-20090702130714-hsyqfusi8vn3a11m
Use tree.has_changes() where appropriate (the test suite caught a
bug in has_changes() (not filtering out the root) in an impressive
number of tests)

* bzrlib/send.py:
(send): Use tree.has_changes() instead of tree.changes_from().

* bzrlib/reconfigure.py:
(Reconfigure._check): Use tree.has_changes() instead of
tree.changes_from().

* bzrlib/merge.py:
(Merger.ensure_revision_trees, Merger.compare_basis): Use
tree.has_changes() instead of tree.changes_from().

* bzrlib/builtins.py:
(cmd_remove_tree.run, cmd_push.run, cmd_merge.run): Use
tree.has_changes() instead of tree.changes_from().

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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
# "weren't nothing promised to you.  do i look like i got a promise face?"
18
18
 
70
70
 
71
71
    def test_format_os_error(self):
72
72
        try:
 
73
            os.rmdir('nosuchfile22222')
 
74
        except OSError:
 
75
            pass
 
76
        msg = _format_exception()
 
77
        self.assertContainsRe(msg,
 
78
            r'^bzr: ERROR: \[Errno .*\] No such file.*nosuchfile22222')
 
79
 
 
80
    def test_format_io_error(self):
 
81
        try:
73
82
            file('nosuchfile22222')
74
 
        except (OSError, IOError):
 
83
        except IOError:
75
84
            pass
76
85
        msg = _format_exception()
77
86
        self.assertContainsRe(msg, r'^bzr: ERROR: \[Errno .*\] No such file.*nosuchfile')
120
129
        self.log(u'the unicode character for benzene is \N{BENZENE RING}')
121
130
        self.assertContainsRe(self._get_log(keep_log_file=True),
122
131
                              "the unicode character for benzene is")
123
 
    
 
132
 
124
133
    def test_trace_argument_unicode(self):
125
134
        """Write a Unicode argument to the trace log"""
126
135
        mutter(u'the unicode character for benzene is %s', u'\N{BENZENE RING}')
186
195
    def test_push_log_file(self):
187
196
        """Can push and pop log file, and this catches mutter messages.
188
197
 
189
 
        This is primarily for use in the test framework. 
 
198
        This is primarily for use in the test framework.
190
199
        """
191
200
        tmp1 = tempfile.NamedTemporaryFile()
192
201
        tmp2 = tempfile.NamedTemporaryFile()