# HG changeset patch # User Patrick Mezard # Date 1340199721 -7200 # Node ID 336210dada956ab8a108be501b93c6431e0dc7f5 # Parent 6622a24f3b0f178227720f3bce1171410f3563fb obsolete: make rebase abort with --keep obsolete modifies rebase to mark rebased changesets obsolete instead of stripping them, which makes --keep irrelevant. diff -r 6622a24f3b0f -r 336210dada95 hgext/obsolete.py --- a/hgext/obsolete.py Tue Jun 19 09:23:50 2012 +0200 +++ b/hgext/obsolete.py Wed Jun 20 15:42:01 2012 +0200 @@ -45,6 +45,12 @@ A ``debugobsolete`` command was added. It adds an obsolete relation between two nodes. +Note that rebased changesets are not marked obsolete rather than being stripped +In this experimental extensions, this is done forcing the --keep option. Trying +to use the --keep option of rebase with this extensionn this experimental +extension will cause such a call to abort. Until better releasen please use +graft command to rebase and copy changesets. + Context object -------------- @@ -231,9 +237,10 @@ return newrev def cmdrebase(orig, ui, repo, *args, **kwargs): - oldkeep = kwargs.pop('keep', False) - if oldkeep: - ui.warn('WARNING --keep option ignored by experimental obsolete extension') + if kwargs.get('keep', False): + raise util.Abort(_('rebase --keep option is unsupported with obsolete ' + 'extension'), hint=_("see 'hg help obsolete'")) + kwargs = dict(kwargs) kwargs['keep'] = True return orig(ui, repo, *args, **kwargs) diff -r 6622a24f3b0f -r 336210dada95 tests/test-obsolete.t --- a/tests/test-obsolete.t Tue Jun 19 09:23:50 2012 +0200 +++ b/tests/test-obsolete.t Wed Jun 20 15:42:01 2012 +0200 @@ -475,4 +475,6 @@ Test rebase --keep warning $ hg --config extensions.rebase= rebase -d 1 --keep - WARNING --keep option ignored by experimental obsolete extension (no-eol) + abort: rebase --keep option is unsupported with obsolete extension + (see 'hg help obsolete') + [255]