Mercurial > hg
comparison hgext/shelve.py @ 42539:5c64d0b4c037
shelve: removed redundant merge detection method
Differential Revision: https://phab.mercurial-scm.org/D6547
author | Taapas Agrawal <taapas2897@gmail.com> |
---|---|
date | Thu, 20 Jun 2019 00:59:16 +0530 |
parents | 0231032729c4 |
children | 80e0ea08b55c |
comparison
equal
deleted
inserted
replaced
42538:2db96bf84a8f | 42539:5c64d0b4c037 |
---|---|
450 return _docreatecmd(ui, repo, pats, opts) | 450 return _docreatecmd(ui, repo, pats, opts) |
451 | 451 |
452 def _docreatecmd(ui, repo, pats, opts): | 452 def _docreatecmd(ui, repo, pats, opts): |
453 wctx = repo[None] | 453 wctx = repo[None] |
454 parents = wctx.parents() | 454 parents = wctx.parents() |
455 if len(parents) > 1: | |
456 raise error.Abort(_('cannot shelve while merging')) | |
457 parent = parents[0] | 455 parent = parents[0] |
458 origbranch = wctx.branch() | 456 origbranch = wctx.branch() |
459 | 457 |
460 if parent.node() != nodemod.nullid: | 458 if parent.node() != nodemod.nullid: |
461 desc = "changes to: %s" % parent.description().split('\n', 1)[0] | 459 desc = "changes to: %s" % parent.description().split('\n', 1)[0] |
977 return unshelveabort(ui, repo, state, opts) | 975 return unshelveabort(ui, repo, state, opts) |
978 elif continuef: | 976 elif continuef: |
979 return unshelvecontinue(ui, repo, state, opts) | 977 return unshelvecontinue(ui, repo, state, opts) |
980 elif len(shelved) > 1: | 978 elif len(shelved) > 1: |
981 raise error.Abort(_('can only unshelve one change at a time')) | 979 raise error.Abort(_('can only unshelve one change at a time')) |
982 | |
983 # abort unshelve while merging (issue5123) | |
984 parents = repo[None].parents() | |
985 if len(parents) > 1: | |
986 raise error.Abort(_('cannot unshelve while merging')) | |
987 | |
988 elif not shelved: | 980 elif not shelved: |
989 shelved = listshelves(repo) | 981 shelved = listshelves(repo) |
990 if not shelved: | 982 if not shelved: |
991 raise error.Abort(_('no shelved changes to apply!')) | 983 raise error.Abort(_('no shelved changes to apply!')) |
992 basename = util.split(shelved[0][1])[1] | 984 basename = util.split(shelved[0][1])[1] |