Commits

Mike Bayer committed 479ef17

- lockrun support
- check for missing slashes

Comments (0)

Files changed (2)

 *.pyc
 .*.swp
 *.egg-info
+.venv
 build/
 dist/
 .coverage
 def _is_uppercase(text):
     return text == text.upper()
 
+def _setup_command(cmd_options, config_dict, lock=False):
+    if lock and "lockrun" in config_dict:
+        cmd_options.extend(config_dict["lockrun"].split())
+    cmd_options.append(config_dict['cmd'])
+
 def _dupl_command(cmd, config, cmd_options, args):
     config_dict = _get_config(config, args)
-    cmd_options.append(config_dict['cmd'])
+    lock = cmd in ("restore", "remove-older-than",
+                    "cleanup", "remove-all-but-n-full")
+    _setup_command(cmd_options, config_dict, lock)
     cmd_options.append(cmd)
     if getattr(args, 'force', False):
         cmd_options.append("--force")
 
 def _backup(config, cmd_options, args):
     config_dict = _get_config(config, args)
-    cmd_options.append(config_dict['cmd'])
+    _setup_command(cmd_options, config_dict, True)
     if args.type != 'auto':
         cmd_options.append(args.type)
 
         if not src_opt:
             continue
         name, opt = re.split(r'\s+', src_opt, 1)
+        if "\n" in opt:
+            raise SystemError(
+                    "WARNING: newline detected in non-slashed "
+                    "line \"%s\"; please double check your config file"
+                    % opt.replace('\n', r'\n'))
         cmd_options.extend((name, opt))
 
     cmd_options.append("/")
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.