Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
bottom = patch.get_bottom()
top = patch.get_top()
bottom = patch.get_bottom()
top = patch.get_top()
+ if fname == '-':
+ f = sys.stdin
+ else:
+ f = open(fname)
message, author_name, author_email, author_date, diff = parse_patch(f)
f.close()
message, author_name, author_email, author_date, diff = parse_patch(f)
f.close()
text = tmpl % tmpl_dict
# write the file to be edited
text = tmpl % tmpl_dict
# write the file to be edited
- f = open(fname, 'w+')
- f.write(text)
- f.close()
+ if fname == '-':
+ sys.stdout.write(text)
+ else:
+ f = open(fname, 'w+')
+ f.write(text)
+ f.close()
def __edit_update_patch(pname, options):
"""Edit the given patch interactively.
def __edit_update_patch(pname, options):
"""Edit the given patch interactively.