Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • mergebot/trunk/mergebot/RebranchActor.py

    r30 r17  
    3636
    3737        # Make sure the various urls we require do exist
    38         problems = self.check_required_directories()
    39         if problems:
    40             return results, problems, False
     38        if not SvnOps.get_branch_info(self.local_url(), logfile):
     39            comment = 'Component %s does not exist in the repository.' \
     40                % self.component
     41            return results, comment, False
     42        if not SvnOps.get_branch_info(self.local_url() + '/branches', logfile):
     43            comment = 'No directory in which to create branches for ' \
     44                'component %s in the repository.' % self.component
     45            return results, comment, False
     46        if not SvnOps.get_branch_info(self.baseline_local_url(), logfile):
     47            comment = 'Version %s for component %s does not exist in the ' \
     48                'repository.' % (self.version, self.component)
     49            return results, comment, False
    4150
    4251        rev_info = SvnOps.get_branch_info(self.branch_local_url(), logfile)
     
    8897                "Rebranch internal error: Unable to recreate the branch.  %s" \
    8998                    % (instructioncomment, )),
     99            (lambda x: SvnOps.checkout(self.branch_local_url(), workingcopy, x),
     100                "Rebranch internal error: Unable to get working copy.  %s" % \
     101                    (instructioncomment, )),
    90102        )
    91103        for cmd, error_comment in commanderrors:
     
    96108                results['mergebotstate'] = 'rebranchfailed'
    97109                return results, error_comment, False
    98 
    99         # Check to see if there have been no commits on the branch.  If there
    100         # have been no commits, we know we don't need to merge anything.
    101         if startrev == endrev:
    102             ticket_message = "\n".join([
    103                 "Rebranched from %s for %s." % (self.version,
    104                                                 self.requestor),
    105                 "There were no changes to commit to the branch since there "
    106                     "were no commits on the branch.",
    107                 "You will need to update your working copy.",
    108             ])
    109             results['mergebotstate'] = 'branched'
    110             return results, ticket_message, True
    111 
    112         retval = SvnOps.checkout(self.branch_local_url(), workingcopy, logfile)
    113         if retval:
    114             error_comment = \
    115                 "Rebranch internal error: Unable to get working copy.  " + \
    116                 instructioncomment
    117             if os.path.exists(workingcopy):
    118                 shutil.rmtree(workingcopy)
    119             results['mergebotstate'] = 'rebranchfailed'
    120             return results, error_comment, False
    121110
    122111        # On success, we're in the same state as if we had just branched.
     
    146135                    "commit your work to the branch.",
    147136            ])
    148             success = False # the rebranch failed because there were conflicts
    149137        else: # No conflicts, do the commit.
    150138            mergemessage = "\n".join([
Note: See TracChangeset for help on using the changeset viewer.