Skip to content

Commit 0034187

Browse files
pftgclaude
andcommitted
refactor: remove SVN support
No Ruby projects have used SVN since ~2015. Removes 25 lines of dead code including svn info parsing and pristine file lookup. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7ffb540 commit 0034187

1 file changed

Lines changed: 1 addition & 30 deletions

File tree

  • lib/capybara/screenshot/diff

lib/capybara/screenshot/diff/vcs.rb

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,7 @@ module Screenshot
77
module Diff
88
module Vcs
99
def self.checkout_vcs(root, screenshot_path, checkout_path)
10-
if svn?(root)
11-
restore_svn_revision(screenshot_path, checkout_path)
12-
else
13-
restore_git_revision(screenshot_path, checkout_path, root: root)
14-
end
15-
end
16-
17-
def self.svn?(root)
18-
(root / ".svn").exist?
10+
restore_git_revision(screenshot_path, checkout_path, root: root)
1911
end
2012

2113
SILENCE_ERRORS = Os::ON_WINDOWS ? "2>nul" : "2>/dev/null"
@@ -45,27 +37,6 @@ def self.restore_git_revision(screenshot_path, checkout_path = screenshot_path,
4537
end
4638
end
4739

48-
def self.restore_svn_revision(screenshot_path, checkout_path)
49-
committed_file_name = screenshot_path + "../.svn/text-base/" + "#{screenshot_path.basename}.svn-base"
50-
if committed_file_name.exist?
51-
FileUtils.cp(committed_file_name, checkout_path)
52-
return true
53-
end
54-
55-
svn_info = `svn info #{screenshot_path} #{SILENCE_ERRORS}`
56-
unless svn_info.empty?
57-
wc_root = svn_info.slice(/(?<=Working Copy Root Path: ).*$/)
58-
checksum = svn_info.slice(/(?<=Checksum: ).*$/)
59-
60-
if checksum
61-
committed_file_name = "#{wc_root}/.svn/pristine/#{checksum[0..1]}/#{checksum}.svn-base"
62-
FileUtils.cp(committed_file_name, checkout_path)
63-
return true
64-
end
65-
end
66-
67-
false
68-
end
6940
end
7041
end
7142
end

0 commit comments

Comments
 (0)