From d1cb1c2aa3fa3421142c433d35772fd106e688b8 Mon Sep 17 00:00:00 2001 From: Dawid Ciecierski Date: Fri, 11 Apr 2014 05:42:32 +0200 Subject: [PATCH] Fix hardcoded line endings A little change that makes the script compatible with the Windows Subversion binary, which uses "\r\n" rather than "\n" line endings as it does on Unix. With this change I had no problem using the tool under Windows. --- svn2svn/run/svnreplay.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/svn2svn/run/svnreplay.py b/svn2svn/run/svnreplay.py index 8669143..f34400e 100644 --- a/svn2svn/run/svnreplay.py +++ b/svn2svn/run/svnreplay.py @@ -36,7 +36,7 @@ def parse_svn_commit_rev(output): """ Parse the revision number from the output of "svn commit". """ - output_lines = output.strip("\n").split("\n") + output_lines = output.strip(os.linesep).split(os.linesep) rev_num = None for line in output_lines: if line[0:19] == 'Committed revision ': @@ -350,7 +350,7 @@ def full_svn_revert(): run_svn(["revert", "--recursive", "."]) output = run_svn(["status"]) if output: - output_lines = output.strip("\n").split("\n") + output_lines = output.strip(os.linesep).split(os.linesep) for line in output_lines: if line[0] == "?": path = line[4:].strip(" ") -- 2.45.2