mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 23:07:18 +03:00
fbamend: abort if preamend bookmark points to the current commit
Differential Revision: https://phabricator.intern.facebook.com/D3436696
This commit is contained in:
parent
f7d38f2065
commit
1d18a2690a
10
fbamend.py
10
fbamend.py
@ -305,11 +305,17 @@ def fixupamend(ui, repo):
|
||||
raise error.Abort(_('no bookmark %s') % preamendname,
|
||||
hint=_('check if your bookmark is active'))
|
||||
|
||||
ui.status(_("rebasing the children of %s\n") % (preamendname))
|
||||
|
||||
old = repo[preamendname]
|
||||
if old == current:
|
||||
hint = _('please examine smartlog and rebase your commits manually')
|
||||
err = _('cannot automatically determine what to rebase '
|
||||
'because bookmark "%s" points to the current commit') % \
|
||||
preamendname
|
||||
raise error.Abort(err, hint=hint)
|
||||
oldbookmarks = old.bookmarks()
|
||||
|
||||
ui.status(_("rebasing the children of %s\n") % (preamendname))
|
||||
|
||||
active = bmactive(repo)
|
||||
opts = {
|
||||
'rev' : [str(c.rev()) for c in old.descendants()],
|
||||
|
@ -651,4 +651,21 @@ Check whether unamend works with dirty working directory
|
||||
A c
|
||||
A d
|
||||
R b
|
||||
$ cd ..
|
||||
|
||||
Check whether fbamend warns people if preamend bookmark is the same as an active
|
||||
bookmark
|
||||
$ hg init messedpreamed && cd messedpreamed
|
||||
$ echo root > root && hg ci -Am root
|
||||
adding root
|
||||
$ hg book -r . activebook
|
||||
$ hg book -r . activebook.preamend
|
||||
$ hg up activebook
|
||||
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
||||
(activating bookmark activebook)
|
||||
$ hg amend --fixup
|
||||
abort: cannot automatically determine what to rebase because bookmark "activebook.preamend" points to the current commit
|
||||
(please examine smartlog and rebase your commits manually)
|
||||
[255]
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user