a/branches/13-jobs/cforge/cforge/Package/CFORGE/Scripts/commit.py | b/branches/13-jobs/cforge/cforge/Package/CFORGE/Scripts/commit.py | ||
---|---|---|---|
... |
... |
||
18 | ["<path to CODESYS project>", "---"] |
18 | ["<path to CODESYS project>", "---"] |
19 | ] |
19 | ] |
20 | 20 | ||
21 | return help |
21 | return help |
22 | 22 | ||
23 | if len(sys.argv) <= 1: |
23 | |
24 | def do(folder, username, password, message): |
||
25 | scriptpath = os.path.abspath(os.path.dirname(sys.argv[0])) |
||
26 | scriptname = os.path.join(scriptpath, "action.svn.commit.py") |
||
27 | scriptargs = "%s %s %s %s" % (username, password, folder, message) |
||
28 | |||
29 | cds_script.RunCodesysWithScript(scriptname, scriptargs, False) |
||
30 | |||
31 | # call main |
||
32 | if __name__ == "__main__": |
||
33 | if len(sys.argv) <= 1: |
||
24 | print("Oh, there are no arguments. Perhaps you forgot something?") |
34 | print("Oh, there are no arguments. Perhaps you forgot something?") |
25 | sys.exit() |
35 | sys.exit() |
26 | 36 | folder = sys.argv[1] |
|
27 | folder = sys.argv[1] |
||
28 | # if folder can't be found, try to interpret it as a repo |
37 | |
38 | # if folder can't be found, try to interpret it as a repo |
||
29 | # name, relatively to the workspace folder |
39 | # name, relatively to the workspace folder |
30 | if not os.path.isdir(folder): |
40 | if not os.path.isdir(folder): |
31 | config = ui.GetSettings() |
41 | config = ui.GetSettings() |
32 | workspace, file = ntpath.split(config['folder']) |
42 | workspace, file = ntpath.split(config['folder']) |
33 | folder = os.path.join(workspace, folder) |
43 | folder = os.path.join(workspace, folder) |
34 | 44 | ||
35 | print("commiting folder: %s" % folder) |
45 | print("commiting folder: %s" % folder) |
36 | 46 | ||
37 | stat = pysvn.svn_get_stat(folder) |
47 | stat = pysvn.svn_get_stat(folder) |
38 | config = ui.Dialog("Commit", Credentials=True, Info=True, InfoText=stat, Message=True) |
48 | config = ui.Dialog("Commit", Credentials=True, Info=True, InfoText=stat, Message=True) |
39 | 49 | ||
40 | if config != None: |
50 | if config != None: |
41 | scriptpath = os.path.abspath(os.path.dirname(sys.argv[0])) |
51 | do(folder, config["user"], config["pass"], config["msg"]) |
42 | scriptname = os.path.join(scriptpath, "action.svn.commit.py") |
||
43 | scriptargs = "%s %s %s %s" % (config["user"], config["pass"], folder, config["msg"]) |
||
44 | 52 | ||
45 | cds_script.RunCodesysWithScript(scriptname, scriptargs, False) |