• Home
  • Raw
  • Download

Lines Matching +full:restore +full:- +full:keys

2 # reserved. Use of this source code is governed by a BSD-style license that
21 sys.stdout.write('--> ' + message + "\n")
26 sys.stdout.write('-' * 80 + "\n")
39 with open(file, 'r', encoding='utf-8') as fp:
55 # Parse command-line options.
77 '--resave',
83 '--reapply',
89 '--revert',
95 '--backup',
99 help='backup patched files. Used in combination with --revert.')
101 '--restore',
103 dest='restore',
105 help='restore backup of patched files that have not changed. If a backup has ' +\
106 'changed the patch file will be resaved. Used in combination with --reapply.')
108 '--patch',
115 '--add',
121 'combination with --resave and a single --patch value.')
130 print('--add can only be used with --resave and a single --patch value.')
197 cmd = 'git checkout -- %s' % (patch_path_abs)
207 msg('Skipping non-existing file %s' % patch_path_abs)
220 with open(patch_path_abs, 'r', encoding='utf-8') as fp:
232 result = exec_cmd('patch -p0', patch_root_abs, patch_string)
235 # Restore Windows line endings in converted files so that the diff is
236 # correct if/when the patch file is re-saved.
248 if result['out'].find('FAILED') != -1:
251 if line.find('FAILED') != -1:
253 warn('Failed to apply %s, fix manually and run with --resave' % \
258 if options.restore:
259 # Restore from backup if a backup exists.
286 msg('Skipping non-existing file %s' % patch_path_abs)
291 cmd = 'git add -N %s' % ' '.join(added_paths)
296 # Re-create the patch file.
298 cmd = 'git diff --no-prefix --relative %s' % patch_paths_str
305 # This will avoid problems when attempting to re-apply the patch
310 f = open(patch_file, 'w', encoding='utf-8')
319 sys.stdout.write("!!!! FAILED PATCHES, fix manually and run with --resave\n")
320 for name in sorted(failed_patches.keys()):
324 # Convert paths to use Windows-style separator.