~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_versioning.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-08-09 15:19:06 UTC
  • mfrom: (2681.1.7 send-bundle)
  • Revision ID: pqm@pqm.ubuntu.com-20070809151906-hdn9oyslf2qib2op
Allow omitting -o for bundle, add --format

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
 
18
18
"""Tests of simple versioning operations"""
148
148
 
149
149
        old = b.repository.revision_tree(b.get_rev_id(1))
150
150
        new = b.repository.revision_tree(b.get_rev_id(2))
151
 
        new.lock_read()
152
151
 
153
152
        eq(new.get_file_by_path('b/two').read(), 'old contents')
154
153
        eq(new.get_file_by_path('top').read(), 'old contents')
155
154
        eq(new.get_file_by_path('a/one').read(), 'new contents')
156
 
        new.unlock()
157
155
 
158
156
        os.chdir('a')
159
157
        # commit from here should do nothing
160
158
        run_bzr(['commit', '.', '-m', 'commit subdir only', '--unchanged'])
161
159
        v3 = b.repository.revision_tree(b.get_rev_id(3))
162
 
        v3.lock_read()
163
160
        eq(v3.get_file_by_path('b/two').read(), 'old contents')
164
161
        eq(v3.get_file_by_path('top').read(), 'old contents')
165
162
        eq(v3.get_file_by_path('a/one').read(), 'new contents')
166
 
        v3.unlock()
167
163
 
168
164
        # commit in subdirectory commits whole tree
169
165
        run_bzr(['commit', '-m', 'commit whole tree from subdir'])
170
166
        v4 = b.repository.revision_tree(b.get_rev_id(4))
171
 
        v4.lock_read()
172
167
        eq(v4.get_file_by_path('b/two').read(), 'new contents')
173
168
        eq(v4.get_file_by_path('top').read(), 'new contents')
174
 
        v4.unlock()
175
169
 
176
170
        # TODO: factor out some kind of assert_tree_state() method
177
171