comparison mercurial/cmdutil.py @ 41536:d783c937aa53

revert: add prompt before undeleting a file in -i (issue6008) This adds a prompt that asks whether or not a removed file is to be undeleted in `hg revert -i`. Differential Revision: https://phab.mercurial-scm.org/D5803
author Taapas Agrawal <taapas2897@gmail.com>
date Sun, 03 Feb 2019 01:02:24 +0530
parents d75fde22de91
children 3a01ce246ece
comparison
equal deleted inserted replaced
41535:bad59bbd9bec 41536:d783c937aa53
3192 3192
3193 normal = repo.dirstate.normallookup 3193 normal = repo.dirstate.normallookup
3194 if node == parent and p2 == nullid: 3194 if node == parent and p2 == nullid:
3195 normal = repo.dirstate.normal 3195 normal = repo.dirstate.normal
3196 for f in actions['undelete'][0]: 3196 for f in actions['undelete'][0]:
3197 prntstatusmsg('undelete', f) 3197 if interactive:
3198 checkout(f) 3198 choice = repo.ui.promptchoice(
3199 normal(f) 3199 _("add back removed file %s (Yn)?$$ &Yes $$ &No") % f)
3200 if choice == 0:
3201 prntstatusmsg('undelete', f)
3202 checkout(f)
3203 normal(f)
3204 else:
3205 excluded_files.append(f)
3206 else:
3207 prntstatusmsg('undelete', f)
3208 checkout(f)
3209 normal(f)
3200 3210
3201 copied = copies.pathcopies(repo[parent], ctx) 3211 copied = copies.pathcopies(repo[parent], ctx)
3202 3212
3203 for f in actions['add'][0] + actions['undelete'][0] + actions['revert'][0]: 3213 for f in actions['add'][0] + actions['undelete'][0] + actions['revert'][0]:
3204 if f in copied: 3214 if f in copied: