import sys, os import cds_script import ui import ntpath # This is a cforge command (script file) # this will be run as ironpython script. # the filename of this script is automatically the corresponding cforge command # with some magic functions you can easily integrate it nicely into cforge tool # cforge_usage: # here you can return an array of all possible arguments and options that can # be passed to this command script def cforge_usage(): help = [ ["", "---"] ] return help if len(sys.argv) <= 1: print("Oh, there are no arguments. Perhaps you forgot something?") sys.exit() folder = sys.argv[1] # if folder can't be found, try to interpret it as a repo # name, relatively to the workspace folder if not os.path.isdir(folder): config = ui.GetSettings() workspace, file = ntpath.split(config['folder']) folder = os.path.join(workspace, folder) print("updating folder: %s" % folder) config = ui.Dialog("Update", Credentials=True) if config != None: scriptpath = os.path.abspath(os.path.dirname(sys.argv[0])) scriptname = os.path.join(scriptpath, "action.svn.update.py") scriptargs = "%s %s %s" % (config["user"], config["pass"], folder) cds_script.RunCodesysWithScript(scriptname, scriptargs, False)