mercurial/cmdutil.py
changeset 30151 381293e1135e
parent 30142 3dcaf1c4e90d
child 30182 144d8fe266d9
equal deleted inserted replaced
30150:c0410814002f 30151:381293e1135e
   644                 exists = False
   644                 exists = False
   645                 samefile = True
   645                 samefile = True
   646 
   646 
   647         if not after and exists or after and state in 'mn':
   647         if not after and exists or after and state in 'mn':
   648             if not opts['force']:
   648             if not opts['force']:
   649                 ui.warn(_('%s: not overwriting - file exists\n') %
   649                 if state in 'mn':
   650                         reltarget)
   650                     msg = _('%s: not overwriting - file already committed\n')
       
   651                     if after:
       
   652                         flags = '--after --force'
       
   653                     else:
       
   654                         flags = '--force'
       
   655                     if rename:
       
   656                         hint = _('(hg rename %s to replace the file by '
       
   657                                  'recording a rename)\n') % flags
       
   658                     else:
       
   659                         hint = _('(hg copy %s to replace the file by '
       
   660                                  'recording a copy)\n') % flags
       
   661                 else:
       
   662                     msg = _('%s: not overwriting - file exists\n')
       
   663                     if rename:
       
   664                         hint = _('(hg rename --after to record the rename)\n')
       
   665                     else:
       
   666                         hint = _('(hg copy --after to record the copy)\n')
       
   667                 ui.warn(msg % reltarget)
       
   668                 ui.warn(hint)
   651                 return
   669                 return
   652 
   670 
   653         if after:
   671         if after:
   654             if not exists:
   672             if not exists:
   655                 if rename:
   673                 if rename: