comparison hgext/narrow/narrowcommands.py @ 41229:50ca531f1f24

narrow: copy store narrowspec to working copy immediately We no longer need to delay it until the end of the transaction since we now restore a backup if the transaction aborts. Differential Revision: https://phab.mercurial-scm.org/D5506
author Martin von Zweigbergk <martinvonz@google.com>
date Sat, 29 Dec 2018 23:01:12 -0800
parents 4475322b7533
children 44a51c1c8e17
comparison
equal deleted inserted replaced
41228:3b35ebdb9f8c 41229:50ca531f1f24
430 fm.write('pat', '%s\n', i, label='narrow.excluded') 430 fm.write('pat', '%s\n', i, label='narrow.excluded')
431 fm.end() 431 fm.end()
432 return 0 432 return 0
433 433
434 if update_working_copy: 434 if update_working_copy:
435 with repo.wlock(), repo.lock(), repo.transaction('narrow-wc') as tr: 435 with repo.wlock(), repo.lock(), repo.transaction('narrow-wc'):
436 narrowspec.updateworkingcopy(repo) 436 narrowspec.updateworkingcopy(repo)
437 narrowspec.copytoworkingcopy(repo, tr) 437 narrowspec.copytoworkingcopy(repo)
438 return 0 438 return 0
439 439
440 if not widening and not narrowing: 440 if not widening and not narrowing:
441 ui.status(_("nothing to widen or narrow\n")) 441 ui.status(_("nothing to widen or narrow\n"))
442 return 0 442 return 0