[PATCH] D32452: [git-llvm] Make `push` work on CRLF files with svn:eol-style=native

Justin Lebar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 24 14:11:34 PDT 2017


jlebar accepted this revision.
jlebar added a comment.
This revision is now accepted and ready to land.

Well that's exciting.

I don't have a position on what Zach is suggesting, but as far as the change to the script goes, I'm happy with it.



================
Comment at: llvm/utils/git-svn/git-llvm:92
+        # Silence errors if requested.
+        err_pipe = open(os.devnull, 'w')
+
----------------
Do we need to close this at some point?


================
Comment at: llvm/utils/git-svn/git-llvm:195
+                sr).split('\n')
+    files = [f.split('/', 1)[1] for f in files]
+    # Use ignore_errors because 'svn propget' prints errors if the file doesn't
----------------
Would prefer to call some os.path function if there's one that DTRT for this, but if not, whatever.


================
Comment at: llvm/utils/git-svn/git-llvm:202
+    for eol_prop in eol_props:
+        (f, eol_style) = eol_prop.strip().split(' - ')
+        if eol_style == 'native':
----------------
Nit, probably want something to guard against the case where the filename contains ' - '.  Probably rsplit(' - ', 1)?


https://reviews.llvm.org/D32452





More information about the llvm-commits mailing list