示例#1
0
    def test_mv_newcase(self):
        wt = self._make_mixed_case_tree()
        self.run_bzr('add')
        self.run_bzr('ci -m message')

        # perform a mv to the new case - we expect bzr to accept the new
        # name, as specified, and rename the file on the file-system too.
        run_script(self, """
            $ bzr mv camelcaseparent/camelcase camelcaseparent/camelCase
            CamelCaseParent/CamelCase => CamelCaseParent/camelCase
            """)
        self.failUnlessEqual(canonical_relpath(wt.basedir, 'camelcaseparent/camelcase'),
                             'CamelCaseParent/camelCase')
示例#2
0
 def _probe(self):
     fileno, name = tempfile.mkstemp(prefix='MixedCase')
     try:
         # first check truly case-preserving for created files, then check
         # case insensitive when opening existing files.
         name = osutils.normpath(name)
         base, rel = osutils.split(name)
         found_rel = osutils.canonical_relpath(base, name)
         return (found_rel == rel
                 and os.path.isfile(name.upper())
                 and os.path.isfile(name.lower()))
     finally:
         os.close(fileno)
         os.remove(name)
示例#3
0
    def test_mv_newcase_after(self):
        wt = self._make_mixed_case_tree()
        self.run_bzr('add')
        self.run_bzr('ci -m message')

        # perform a mv to the new case - we must ensure the file-system has the
        # new case first.
        osutils.rename('CamelCaseParent/CamelCase', 'CamelCaseParent/camelCase')
        run_script(self, """
            $ bzr mv --after camelcaseparent/camelcase camelcaseparent/camelCase
            CamelCaseParent/CamelCase => CamelCaseParent/camelCase
            """)
        # bzr should not have renamed the file to a different case
        self.failUnlessEqual(canonical_relpath(wt.basedir, 'camelcaseparent/camelcase'),
                             'CamelCaseParent/camelCase')
    def test_mv_newcase(self):
        wt = self._make_mixed_case_tree()
        self.run_bzr('add')
        self.run_bzr('ci -m message')

        # perform a mv to the new case - we expect bzr to accept the new
        # name, as specified, and rename the file on the file-system too.
        run_script(
            self, """
            $ bzr mv camelcaseparent/camelcase camelcaseparent/camelCase
            CamelCaseParent/CamelCase => CamelCaseParent/camelCase
            """)
        self.failUnlessEqual(
            canonical_relpath(wt.basedir, 'camelcaseparent/camelcase'),
            'CamelCaseParent/camelCase')
    def test_mv_newcase_after(self):
        wt = self._make_mixed_case_tree()
        self.run_bzr('add')
        self.run_bzr('ci -m message')

        # perform a mv to the new case - we must ensure the file-system has the
        # new case first.
        osutils.rename('CamelCaseParent/CamelCase',
                       'CamelCaseParent/camelCase')
        run_script(
            self, """
            $ bzr mv --after camelcaseparent/camelcase camelcaseparent/camelCase
            CamelCaseParent/CamelCase => CamelCaseParent/camelCase
            """)
        # bzr should not have renamed the file to a different case
        self.failUnlessEqual(
            canonical_relpath(wt.basedir, 'camelcaseparent/camelcase'),
            'CamelCaseParent/camelCase')