~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: abentley
  • Date: 2006-04-20 23:47:53 UTC
  • mfrom: (1681 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1683.
  • Revision ID: abentley@lappy-20060420234753-6a6874b76f09f86d
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Copyright (C) 2006 by Canonical Ltd
2
 
# -*- coding: utf-8 -*-
3
2
 
4
3
# This program is free software; you can redistribute it and/or modify
5
4
# it under the terms of the GNU General Public License as published by
17
16
 
18
17
import os
19
18
 
 
19
from bzrlib.workingtree import WorkingTree
20
20
from bzrlib.tests.blackbox import ExternalBase
21
21
 
22
22
class TestConflicts(ExternalBase):
62
62
        conflicts = self.runbzr('conflicts', backtick=True)
63
63
        self.assertEqual(len(conflicts.splitlines()), 0)
64
64
 
 
65
    def test_resolve_in_subdir(self):
 
66
        """resolve when run from subdirectory should handle relative paths"""
 
67
        orig_dir = os.getcwdu()
 
68
        try:
 
69
            os.mkdir("subdir")
 
70
            os.chdir("subdir")
 
71
            self.runbzr("resolve ../myfile")
 
72
            os.chdir("../../b")
 
73
            self.runbzr("resolve ../a/myfile")
 
74
            wt = WorkingTree.open_containing('.')[0]
 
75
            conflicts = wt.conflicts()
 
76
            if not conflicts.is_empty():
 
77
                self.fail("tree still contains conflicts: %r" % conflicts)
 
78
        finally:
 
79
            os.chdir(orig_dir)