llvm.org GIT mirror llvm / 4e7b8c0
[git-llvm] Handle files ignored by svn correctly Summary: Correctly handle files ignored by svn (such as .o files, which are ignored by default) by adding "--no-ignore" flag to "svn status" and "svn add". Differential Revision: https://reviews.llvm.org/D41404 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321388 91177308-0d34-0410-b5e6-96231b3b80d8 Walter Lee 1 year, 9 months ago
1 changed file(s) with 7 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
177177
178178 # Unfortunately it appears there's no svn equivalent for git clean, so we
179179 # have to do it ourselves.
180 for line in svn(svn_repo, 'status').split('\n'):
180 for line in svn(svn_repo, 'status', '--no-ignore').split('\n'):
181181 if not line.startswith('?'):
182182 continue
183183 filename = line[1:].strip()
251251 if not subrepos:
252252 raise RuntimeError('Empty diff for rev %s?' % rev)
253253
254 status = svn(svn_repo, 'status')
254 status = svn(svn_repo, 'status', '--no-ignore')
255255 if status:
256256 die("Can't push git rev %s because svn status is not empty:\n%s" %
257257 (rev, status))
271271 "first?")
272272 sys.exit(2)
273273
274 status_lines = svn(svn_repo, 'status').split('\n')
275
276 for l in (l for l in status_lines if l.startswith('?')):
277 svn(svn_repo, 'add', l[1:].strip())
274 status_lines = svn(svn_repo, 'status', '--no-ignore').split('\n')
275
276 for l in (l for l in status_lines if (l.startswith('?') or
277 l.startswith('I'))):
278 svn(svn_repo, 'add', '--no-ignore', l[1:].strip())
278279 for l in (l for l in status_lines if l.startswith('!')):
279280 svn(svn_repo, 'remove', l[1:].strip())
280281