Ignore:
Timestamp:
Feb 23, 2010 10:14:08 PM (15 years ago)
Author:
retracile
Message:

Mergebot: handle property merge conflicts, and add tests for it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mergebot/trunk/utils/test.py

    r60 r62  
    250250        self.assertEqual(retval, 0, "svn mv failed with error %s" % (retval))
    251251
     252    def propset(self, propname, propvalue, filename):
     253        retval = call(['svn', 'propset', propname, propvalue, filename],
     254            cwd=self.get_workdir(),
     255            stdout=logfile, stderr=logfile)
     256        self.assertEqual(retval, 0, "svn prposet failed with error %s" % (retval))
     257       
     258
    252259
    253260class MergeBotTestEnabled(FunctionalTwillTestCaseSetup):
     
    363370
    364371
     372class MergeBotTestMergeWithPropertyConflict(FunctionalSvnTestCaseSetup):
     373    def runTest(self):
     374        """Verify that the 'merge' button detects property conflicts between the branch and trunk"""
     375        ticket_id = self._tester.create_ticket(summary=self.__class__.__name__,
     376            info={'component':'stuff', 'version':'trunk'})
     377        basename = self.__class__.__name__
     378
     379        self.checkout()
     380        self.propset('svn:ignore', basename, '.')
     381        self.commit('set property on trunk')
     382
     383        # create the branch
     384        self._tester.branch(ticket_id, 'stuff')
     385
     386        # modify the property on trunk
     387        self.propset('svn:ignore', basename + '\ntrunk', '.')
     388        self.commit('Modify the property on trunk')
     389
     390        # modify the property on the branch
     391        self.switch(ticket_id)
     392        self.propset('svn:ignore', basename + '\nbranch', '.')
     393        self.commit('Modify the property on branch')
     394
     395        # merge, make sure it shows a conflict
     396        self._tester.merge_conflict(ticket_id, 'stuff')
     397
     398
    365399class MergeBotTestMergeWithBranchRenameConflict(FunctionalSvnTestCaseSetup):
    366400    def runTest(self):
     
    486520        open(os.path.join(self.get_workdir(), basename), 'a').write(random_sentence())
    487521        self.commit('Modify the file on branch')
     522
     523        # rebranch, make sure it shows a conflict
     524        self._tester.rebranch_conflict(ticket_id, 'stuff')
     525
     526
     527class MergeBotTestRebranchWithPropertyConflict(FunctionalSvnTestCaseSetup):
     528    def runTest(self):
     529        """Verify that the 'rebranch' button detects property conflicts between the branch and trunk"""
     530        ticket_id = self._tester.create_ticket(summary=self.__class__.__name__,
     531            info={'component':'stuff', 'version':'trunk'})
     532        basename = self.__class__.__name__
     533
     534        self.checkout()
     535        self.propset('svn:ignore', basename, '.')
     536        self.commit('set property on trunk')
     537
     538        # create the branch
     539        self._tester.branch(ticket_id, 'stuff')
     540
     541        # modify the property on trunk
     542        self.propset('svn:ignore', basename + '\ntrunk', '.')
     543        self.commit('Modify the property on trunk')
     544
     545        # modify the property on the branch
     546        self.switch(ticket_id)
     547        self.propset('svn:ignore', basename + '\nbranch', '.')
     548        self.commit('Modify the property on branch')
    488549
    489550        # rebranch, make sure it shows a conflict
     
    587648    suite.addTest(MergeBotTestRebranchWithChangeAndTrunkChange())
    588649    suite.addTest(MergeBotTestRebranchWithConflict())
     650    suite.addTest(MergeBotTestRebranchWithPropertyConflict())
    589651    suite.addTest(MergeBotTestRebranchWithBranchRenameConflict())
    590652    suite.addTest(MergeBotTestRebranchWithTrunkRenameConflict())
     
    592654    suite.addTest(MergeBotTestMergeWithChangeAndTrunkChange())
    593655    suite.addTest(MergeBotTestMergeWithConflict())
     656    suite.addTest(MergeBotTestMergeWithPropertyConflict())
    594657    suite.addTest(MergeBotTestMergeWithBranchRenameConflict())
    595658    suite.addTest(MergeBotTestMergeWithTrunkRenameConflict())
Note: See TracChangeset for help on using the changeset viewer.