Changeset 36


Ignore:
Timestamp:
Feb 22, 2010 6:19:26 PM (15 years ago)
Author:
retracile
Message:

Mergebot: attempt to use the subversion version number to select correct behavior

File:
1 edited

Legend:

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

    r35 r36  
    2020    """A library to provide a higher-level set of subversion operations."""
    2121    def __init__(self):
    22         pass
     22        self.svn_version = self.get_svn_version()
    2323
     24    def get_svn_version(self):
     25        svn = subprocess.Popen(['svn', '--version', '--quiet'], stdout=subprocess.PIPE)
     26        svn.stdin.close()
     27        version_string, _stderr = svn.stdout.communicate()
     28        return [int(x) for x in version_string.split('.')]
     29       
    2430    def logcmd(self, cmd, logfile):
    2531        """Log the cmd string, then execute it, appending its stdout and stderr
     
    4652                        stderr=open('/dev/null', 'w'))
    4753
    48     does_url_exist = does_url_exist_14 # default to most compatible form for now
     54    def does_url_exist(self, url):
     55        if self.svn_version[:2] == (1,4):
     56            return self.does_url_exist_14(url)
     57        return self.does_url_exist_15(url)
    4958
    5059    def get_branch_info(self, url, logfile):
Note: See TracChangeset for help on using the changeset viewer.