(root, self._config["PATCH_FILE"]),
cwd=self._options.svn):
self.Die("Could not apply patch.")
- # Recursively add possibly newly added files.
- self.Command("svn", "add --force %s" % root, cwd=self._options.svn)
+ for line in self.Command(
+ "svn", "status", cwd=self._options.svn).splitlines():
+ # Check for added and removed items. Svn status has seven status columns.
+ # The first contains ? for unknown and ! for missing.
+ match = re.match(r"^(.)...... (.*)$", line)
+ if match and match.group(1) == "?":
+ self.Command("svn", "add --force %s" % match.group(2),
+ cwd=self._options.svn)
+ if match and match.group(1) == "!":
+ self.Command("svn", "delete --force %s" % match.group(2),
+ cwd=self._options.svn)
+
self.Command(
"svn",
"commit --non-interactive --username=%s --config-dir=%s -m \"%s\"" %
Cmd("svn status", "", cwd=svn_root),
Cmd("patch -d trunk -p1 -i %s" %
TEST_CONFIG["PATCH_FILE"], "Applied patch...", cwd=svn_root),
- Cmd("svn add --force trunk", "", cwd=svn_root),
+ Cmd("svn status", "M OWNERS\n? new_file\n! AUTHORS",
+ cwd=svn_root),
+ Cmd("svn add --force new_file", "", cwd=svn_root),
+ Cmd("svn delete --force AUTHORS", "", cwd=svn_root),
Cmd("svn commit --non-interactive --username=author@chromium.org "
"--config-dir=[CONFIG_DIR] "
"-m \"Version 3.22.5 (based on push_hash)\"",
Cmd("svn status", "", cwd=svn_root),
Cmd("patch -d branches/bleeding_edge -p1 -i %s" %
TEST_CONFIG["PATCH_FILE"], "Applied patch...", cwd=svn_root),
- Cmd("svn add --force branches/bleeding_edge", "", cwd=svn_root),
+ Cmd("svn status", "M src/version.cc", cwd=svn_root),
Cmd("svn commit --non-interactive --username=author@chromium.org "
"--config-dir=[CONFIG_DIR] "
"-m \"[Auto-roll] Bump up version to 3.11.6.0\"",