summaryrefslogtreecommitdiffstats
path: root/lldb/utils/git-svn/convert.py
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-07-23 17:23:36 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-07-23 17:23:36 +0000
commit6491076ec6800f54a8b1d09a95566b36db00f99d (patch)
treefaee8f559629a7acaf38aac7d03522cfe49b7d3e /lldb/utils/git-svn/convert.py
parent6f13637a3e130980456f37647f7628aa7fa7a2b6 (diff)
downloadbcm5719-llvm-6491076ec6800f54a8b1d09a95566b36db00f99d.tar.gz
bcm5719-llvm-6491076ec6800f54a8b1d09a95566b36db00f99d.zip
[Utils] Remove legacy scripts
As pointed out by Nathan in D65155, these scrips don't seem to serve any real need anymore. llvm-svn: 366827
Diffstat (limited to 'lldb/utils/git-svn/convert.py')
-rwxr-xr-xlldb/utils/git-svn/convert.py73
1 files changed, 0 insertions, 73 deletions
diff --git a/lldb/utils/git-svn/convert.py b/lldb/utils/git-svn/convert.py
deleted file mode 100755
index b6e54ed80b7..00000000000
--- a/lldb/utils/git-svn/convert.py
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/usr/bin/env python
-
-"""
-Convert the raw message sources from git patch emails to git-am friendly files.
-
-Usage:
-
-1. Mail.app -> Save As -> api.eml (Raw Message Source)
-2. .../convert.py api.eml
-3. git am [--signoff] < api.eml
-4. git svn dcommit [--commit-url https://id@llvm.org/svn/llvm-project/lldb/trunk]
-"""
-
-from __future__ import print_function
-
-import os
-import re
-import sys
-import io
-
-
-def usage(problem_file=None):
- if problem_file:
- print("%s is not a file" % problem_file)
- print("Usage: convert.py raw-message-source [raw-message-source2 ...]")
- sys.exit(0)
-
-
-def do_convert(file):
- """Skip all preceding mail message headers until 'From: ' is encountered.
- Then for each line ('From: ' header included), replace the dos style CRLF
- end-of-line with unix style LF end-of-line.
- """
- print("converting %s ..." % file)
-
- with open(file, 'r') as f_in:
- content = f_in.read()
-
- # The new content to be written back to the same file.
- new_content = io.StringIO()
-
- # Boolean flag controls whether to start printing lines.
- from_header_seen = False
-
- # By default, splitlines() don't include line breaks. CRLF should be gone.
- for line in content.splitlines():
- # Wait till we scan the 'From: ' header before start printing the
- # lines.
- if not from_header_seen:
- if not line.startswith('From: '):
- continue
- else:
- from_header_seen = True
-
- print(line, file=new_content)
-
- with open(file, 'w') as f_out:
- f_out.write(new_content.getvalue())
-
- print("done")
-
-
-def main():
- if len(sys.argv) == 1:
- usage()
- # Convert the raw message source one by one.
- for file in sys.argv[1:]:
- if not os.path.isfile(file):
- usage(file)
- do_convert(file)
-
-if __name__ == '__main__':
- main()
OpenPOWER on IntegriCloud