Skip to content

Commit a2e4675

Browse files
author
Peter Degen-Portnoy
committed
Merge pull request #18 from notalex/OTWO-3222
OTWO-3222: Fix svn checkout failures during svn-git conversion
2 parents 097c7fa + 3a15341 commit a2e4675

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

lib/scm/adapters/git/pull.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@ def convert(source_scm)
9393
r.scm.checkout(r, url)
9494
end
9595

96+
# Sometimes svn conflicts occur leading to a silent `svn checkout` failure.
97+
if source_scm.is_a?(SvnAdapter) && SvnAdapter.has_conflicts?(url)
98+
logger.info { "Working copy has svn conflicts. Cleaning and trying again..." }
99+
clean_up_disk
100+
r.scm.checkout(r, url)
101+
end
102+
96103
logger.debug { "Committing revision #{r.token} (#{i+1} of #{commits.size})... " }
97104
commit_all(r)
98105
end

lib/scm/adapters/svn/misc.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,5 +132,11 @@ def opt_auth
132132
opt_password = "--username='#{self.username}' --password='#{self.password}'" if self.username && self.username != ''
133133
" #{opt_password} --no-auth-cache "
134134
end
135+
136+
class << self
137+
def has_conflicts?(working_copy_url)
138+
system("cd '#{ working_copy_url }' && svn status | grep 'Summary of conflicts'")
139+
end
140+
end
135141
end
136142
end

0 commit comments

Comments
 (0)