# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1325015146 -3600
#      Tue Dec 27 20:45:46 2011 +0100
# Node ID 306e84e8bbe9a34a9cf7d6554900dfce774df749
# Parent  5b384b7f48d5c4d4b043f5cf7ca78f3f2869846e
rebase: allow --detach when --rev is used

--rev is only a more specific --source and there is no reason to refuse to use
detach with it.

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -168,7 +168,7 @@
                 raise util.Abort(_('cannot specify both a '
                                    'revision and a source'))
             if detachf:
-                if not srcf:
+                if not (srcf or revf):
                     raise util.Abort(
                         _('detach requires a revision to be specified'))
                 if basef: