@ -1347,7 +1347,7 @@ class Changelist(object):
self . issue = None
self . issue = None
self . patchset = None
self . patchset = None
def GetChange ( self , upstream_branch , author ):
def GetChange ( self , upstream_branch , author , local_description = False ):
if not self . GitSanityChecks ( upstream_branch ) :
if not self . GitSanityChecks ( upstream_branch ) :
DieWithError ( ' \n Git sanity check failure ' )
DieWithError ( ' \n Git sanity check failure ' )
@ -1372,7 +1372,7 @@ class Changelist(object):
issue = self . GetIssue ( )
issue = self . GetIssue ( )
patchset = self . GetPatchset ( )
patchset = self . GetPatchset ( )
if issue :
if issue and not local_description :
description = self . GetDescription ( )
description = self . GetDescription ( )
else :
else :
# If the change was never uploaded, use the log messages of all commits
# If the change was never uploaded, use the log messages of all commits
@ -3605,7 +3605,8 @@ def CMDdescription(parser, args):
parser . add_option ( ' -d ' , ' --display ' , action = ' store_true ' ,
parser . add_option ( ' -d ' , ' --display ' , action = ' store_true ' ,
help = ' Display the description instead of opening an editor ' )
help = ' Display the description instead of opening an editor ' )
parser . add_option ( ' -n ' , ' --new-description ' ,
parser . add_option ( ' -n ' , ' --new-description ' ,
help = ' New description to set for this issue (- for stdin) ' )
help = ' New description to set for this issue (- for stdin, '
' + to load from local commit HEAD) ' )
_add_codereview_select_options ( parser )
_add_codereview_select_options ( parser )
auth . add_auth_options ( parser )
auth . add_auth_options ( parser )
@ -3644,6 +3645,10 @@ def CMDdescription(parser, args):
text = options . new_description
text = options . new_description
if text == ' - ' :
if text == ' - ' :
text = ' \n ' . join ( l . rstrip ( ) for l in sys . stdin )
text = ' \n ' . join ( l . rstrip ( ) for l in sys . stdin )
elif text == ' + ' :
base_branch = cl . GetCommonAncestorWithUpstream ( )
change = cl . GetChange ( base_branch , None , local_description = True )
text = change . FullDescriptionText ( )
description . set_description ( text )
description . set_description ( text )
else :
else :