From 200160334e17d804acfd048101a70a652a63d1d3 Mon Sep 17 00:00:00 2001 From: ArneBachmann Date: Thu, 21 Dec 2017 21:42:29 +0100 Subject: [PATCH] Preparing issue #8 --- README.md | 2 +- setup.py | 2 +- sos/sos.coco | 15 +++++++++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ce989d7..d7f61fe 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Subversion Offline Solution (SOS 1.0.3) # +# Subversion Offline Solution (SOS 1.0.4) # [![Travis badge](https://travis-ci.org/ArneBachmann/sos.svg?branch=master)](https://travis-ci.org/ArneBachmann/sos) [![Build status](https://ci.appveyor.com/api/projects/status/fe915rtx02buqe4r?svg=true)](https://ci.appveyor.com/project/ArneBachmann/sos) diff --git a/setup.py b/setup.py index 8abbf87..f837b01 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ import os, shutil, subprocess, sys, time, unittest from setuptools import setup, find_packages -RELEASE = "1.0.3" +RELEASE = "1.0.4" readmeFile = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'README.md') if 'build' in sys.argv: diff --git a/sos/sos.coco b/sos/sos.coco index f2d6180..a928d32 100644 --- a/sos/sos.coco +++ b/sos/sos.coco @@ -767,6 +767,9 @@ def config(argument:str, options:List[str] = []) -> None: f, g = saveConfig(c) if f is None: error("Error saving user configuration: %r" % g) +def move(relpath:str, pattern:str, newrelpath:str, newpattern:str, options:List[str] = []) -> None: + pass + def parse(root:str, cwd:str): ''' Main operation. Main has already chdir into VCS root folder, cwd is original working directory for add, rm. ''' debug("Parsing command-line arguments...") @@ -775,23 +778,27 @@ def parse(root:str, cwd:str): options = sys.argv[3:] if command == "config" else [c for c in sys.argv[2:] if c.startswith("--")] # consider second parameter for no-arg command, otherwise from third on onlys, excps = parseOnlyOptions(cwd, options) # extracts folder-relative information for changes, commit, diff, switch, update debug("Processing command %r with argument '%s' and options %r." % (command ?? "", argument ?? "", options)) - if command[:1] in "ar": relpath, pattern = relativize(root, os.path.join(cwd, argument)) + if command[:1] in "amr": relpath, pattern = relativize(root, os.path.join(cwd, argument)) + if command[:1] == "m": newrelpath, newpattern = relativize(root, os.path.join(cwd, options[0])) # TODO add error message if target pattern is missing if command[:1] == "a": add(relpath, pattern, options) elif command[:1] == "b": branch(argument, options) elif command[:2] == "ch": changes(argument, options, onlys, excps) - elif command[:3] == "com" or command[:2] == "ci": commit(argument, options, onlys, excps) + elif command[:3] == "com": commit(argument, options, onlys, excps) + elif command[:2] == "ci": commit(argument, options, onlys, excps) elif command[:3] == 'con': config(argument, options) elif command[:2] == "de": delete(argument, options) elif command[:2] == "di": diff(argument, options, onlys, excps) elif command[:1] == "h": usage() elif command[:2] == "lo": log(options) - elif command[:2] in ["li", "ls"]: ls(argument) + elif command[:2] == "li": ls(argument) + elif command[:2] == "ls": ls(argument) + elif command[:1] == "m": move(relpath, pattern, newrelpath, newpattern, options[1:]) elif command[:2] == "of": offline(argument, options) elif command[:2] == "on": online(options) elif command[:1] == "r": rm(relpath, pattern) elif command[:2] == "st": status() elif command[:2] == "sw": switch(argument, options, onlys, excps) - elif command[:2] == "u": update(argument, options, onlys, excps) + elif command[:2] == "u": update(argument, options, onlys, excps) else: Exit("Unknown command '%s'" % command) sys.exit(0)