summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f421375)
It is sometimes useful to add some notes to the log entry when a patch
was refreshed. This option was dropped when the command was updated to
the new infrastructure as there was no logging support at that time.
The note will be visible with 'stg log {-g,-f}'
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
short = 'Refresh (applied) PATCH instead of the top patch'),
opt('-e', '--edit', action = 'store_true',
short = 'Invoke an editor for the patch description'),
short = 'Refresh (applied) PATCH instead of the top patch'),
opt('-e', '--edit', action = 'store_true',
short = 'Invoke an editor for the patch description'),
+ opt('-a', '--annotate', metavar = 'NOTE',
+ short = 'Annotate the patch log entry')
] + (argparse.message_options(save_template = False) +
argparse.sign_options() + argparse.author_options())
] + (argparse.message_options(save_template = False) +
argparse.sign_options() + argparse.author_options())
# leave the temp patch for the user.
return False
# leave the temp patch for the user.
return False
-def absorb(stack, patch_name, temp_name, edit_fun):
+def absorb(stack, patch_name, temp_name, edit_fun, annotate = None):
"""Absorb the temp patch into the target patch."""
"""Absorb the temp patch into the target patch."""
- trans = transaction.StackTransaction(stack, 'refresh')
+ if annotate:
+ log_msg = 'refresh\n\n' + annotate
+ else:
+ log_msg = 'refresh'
+ trans = transaction.StackTransaction(stack, log_msg)
iw = stack.repository.default_iw
f = { True: absorb_applied, False: absorb_unapplied
}[patch_name in trans.applied]
iw = stack.repository.default_iw
f = { True: absorb_applied, False: absorb_unapplied
}[patch_name in trans.applied]
diff_flags = [], replacement_diff = None)
assert not failed_diff
return cd
diff_flags = [], replacement_diff = None)
assert not failed_diff
return cd
- return absorb(stack, patch_name, temp_name, edit_fun)
+ return absorb(stack, patch_name, temp_name, edit_fun,
+ annotate = options.annotate)