def main(): try: working_copy = _get_working_copy(sys.argv) client = local.LocalClient(working_copy) client.callback_get_login = login_handler c = curse.Curse() c.update_status_line( "w: view working copy status, r: browse remote repo, q: quit") while True: ch = c.screen.getch() if ch == ord('r'): browse_repo(c, client, working_copy) elif ch == ord('w'): view_status(c, client, working_copy) elif ch == ord('q'): c.quit() break # Exit the while() except exception.SvnException as e: #add log pass except curses.error as e: #add log pass
def bisicles_repo(bisicles_dir): """Get SVN repository info for BISICLES.""" output = f"\n{HLINE * 2} Repository Information {HLINE * 2}\n" # for sftwr in ["BISICLES", "Chombo"]: # for vers in ["release", "trunk"]: for sftwr, vers in [("BISICLES", "trunk"), ("Chombo", "trunk"), ("Chombo", "release")]: repo_dir = Path(bisicles_dir, f"{sftwr}_{vers}") client = svnl.LocalClient(repo_dir) try: info = client.info() except ET.ParseError: output += "#### XML PARSE ERROR ####\n" continue # Make sure there aren't newer entries in the log...svn is weird? log = list(client.log_default(revision_from=info["commit_revision"])) latest = log[-1] try: message = f"{latest.msg.strip()}" except (TypeError, AttributeError): message = "NO MESSAGE" if len(message) > 70: message = f"{message[:70]}..." output += f"""{sftwr}: {vers} URL: {info['url']} Current rev: {latest.revision} info rev: {info['commit_revision']} Author: {latest.author} Message: {message} Date: {latest.date.strftime('%Y-%m-%d %H:%M')} """ output += f"{'-' * 55}\n" return output
def __init__(self, path): self.local_path = path self.client = svn.LocalClient(path) self._updateInfo() if not os.path.exists(self.local_path): raise RuntimeError("'%s' does not exist on disk" % self)
def update_function(self, pFunctionName): ''' Updates the folder of a function from a repository ::param str pFunctionName: the function name ''' if os.path.isdir('./'+pFunctionName): l = local.LocalClient('./'+pFunctionName) l.update('./'+pFunctionName) logger.info("The function %s updated succesfully" % pFunctionName) else: logger.error("The function %s is not configured in your project" % pFunctionName)
def main(): """Main function.""" logger.info('Program started.') try: base = _get_working_copy(sys.argv) client = local.LocalClient(base) client.callback_get_login = login_handler nav = Navigation(client, base) nav.base_status() nav.input_nav() except OSError as exc: logger.error(traceback.format_exc()) print(exc) sys.exit(1) except Exception: logger.error(traceback.format_exc()) logger.info('Program done.')