Esempio n. 1
0
    def pull(self):
        with self._actionlock:
            try:
                latest_before_pull = get_latest_commit()
            
                self._repo.remotes.origin.pull(progress=self._progress)

                after_pull = get_latest_commit()
            
            # The developers at the mailing list were unable to tell me
            # if the pull() would raise an exception on merge conflicts
            # or which exception would be raised. So I'm catching all and
            # verifying if there are conflicts in an exception and in the
            # case were no exceptions were raised
            except Exception:
                self.handle_conflicts(latest_before_pull)
                raise GitClientError(self.UPD_ERROR_MSG)
            else:
                self.handle_conflicts(latest_before_pull)
                changelog = ChangeLog(latest_before_pull, after_pull)
                return changelog
Esempio n. 2
0
    def pull(self):
        with self._actionlock:
            try:
                latest_before_pull = get_latest_commit()

                self._repo.remotes.origin.pull(progress=self._progress)

                after_pull = get_latest_commit()

            # The developers at the mailing list were unable to tell me
            # if the pull() would raise an exception on merge conflicts
            # or which exception would be raised. So I'm catching all and
            # verifying if there are conflicts in an exception and in the
            # case were no exceptions were raised
            except Exception:
                self.handle_conflicts(latest_before_pull)
                raise GitClientError(self.UPD_ERROR_MSG)
            else:
                self.handle_conflicts(latest_before_pull)
                changelog = ChangeLog(latest_before_pull, after_pull)
                return changelog
Esempio n. 3
0
def get_w3af_version():
    '''
    :return: A string with the w3af version.
    '''
    commit = to_short_id(get_latest_commit()) if is_git_repo() else 'unknown'
    cdate = ' - %s' % get_latest_commit_date() if is_git_repo() else ''
    
    vnumber = file(VERSION_FILE).read().strip()
    
    return ('w3af - Web Application Attack and Audit Framework\n'
            'Version: %s\n'
            'Revision: %s%s\n'
            'Author: Andres Riancho and the w3af team.') % (vnumber, commit,
                                                            cdate)
Esempio n. 4
0
 def test_get_latest_commit(self):
     latest_commit = get_latest_commit()
     
     self.assertEqual(len(latest_commit), 40)
     self.assertIsInstance(latest_commit, basestring)
Esempio n. 5
0
    def test_get_latest_commit(self):
        latest_commit = get_latest_commit()

        self.assertEqual(len(latest_commit), 40)
        self.assertIsInstance(latest_commit, basestring)