[PATCH] D65416: Fix git-llvm to not delete non-empty directories.
James Y Knight via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 30 07:35:43 PDT 2019
jyknight marked an inline comment as done.
jyknight added inline comments.
================
Comment at: llvm/utils/git-svn/git-llvm:370
- for l in (l for l in status_lines if l.startswith('!')):
- svn(svn_repo, 'remove', l[1:].strip())
----------------
mehdi_amini wrote:
> I assume we can't just check here the status in git instead because the mapping from SVN -> monorepo is not straightforward to get?
We don't have a reverse mapping at the moment.
But the larger issue is that svn status only reports the toplevel missing directory -- not the subdirs/files under it. So, we'd have to mkdir the toplevel dir, then parse svn status again, to test if we need to recreate or remove the newly-exposed subdirs, and repeat until nothing changes. That seemed a lot more complex.
I also started out thinking I'd remove the svn status parsing in favor of using the git diff status outputs for file addition too. But then realized you cannot 'svn add' files if their containing directory hasn't been added yet, and it's not entirely trivial to determine when to call 'svn add' on the dir. So, in the end I left directory/file addition alone, and only switched over deletion.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65416/new/
https://reviews.llvm.org/D65416
More information about the llvm-commits
mailing list