Why can't I rebase on to an ancestor of source changesets if on a different branch?

I would like to know why the following pattern is not possible.

Having created a local feature branch (minor_feature - not intended to be shared with the world) I would like to rebase the work on it on to the tip of a well known branch (stable). However I have discovered that rebase finds nothing to be rebased in the case where stable has not progressed since branching away from it.

I appreciate that this breaks the rule that the destination of rebase can not be an ancestor of the source but can't work out why this should be prohibited in the simple case shown. I also understand that, branches aside, the topology would not actually change during the rebase. But given that the branch names are indeed significant to the topology, it only seems to be a special case in that stable has no further revisions commited to it. With a single extra revision on the tip of stable (say pulled in from elsewhere) I can of course perform the rebase

o branch:minor_feature | rev:4 | changeset:746d8191aa5d | o branch:minor_feature | rev:3 | changeset:520f565ba7f2 | @ branch:stable | rev:2 | changeset:64e7c753c090 | o branch:stable | rev:1 | changeset:3dc55a5c9971 | o branch:stable rev:0 changeset:fbf1f426945c $hg rebase -b minor_feature nothing to rebase

-- Thanks Chris Gorman


Rebase is strictly for changing ancestry of changesets. As you've observed, you're not changing ancestry here. Branches aren't included in the ancestry computation.

I'm not 100% sure what you're trying to accomplish. If it's to effectively remove the branch, then as long as you haven't pushed, you can likely use the MQ extension. Import the changesets, pop all. Ensure you're updated to the stable branch (which it should be by default), and push them all back on.

They should now all be on the stable branch.


You can do this with the convert extension. You would use a branchmap to rebase minor_feature to default. That file (we'll call it alldefault) would look something like this:

minor_branch default

Then the command would just be:

$ hg convert --branchmap alldefault oldrepo newrepo

When it finishes, newrepo will have the named branch "rebased" on top of the default branch.


  • Why isn't GCC giving me an error
  • Changing profile after a specific time interval on windows phone 7.5
  • Using subprocess module to work in parallel (Multi-process)
  • How does Sqoop append command will work in hadoop
  • Is it possible to remove Google logo?
  • pre-revprop-change hook either failed
  • Does MySQL InnoDB engine run any performance optimization for read-only transactions
  • NoMethodError within nested model form
  • How to Set spoutconfig from default setting?
  • Kafka Streams for count a total num?
  • How to prepare existing database for location aware searching?
  • sstableloader does not exit after successful data loading
  • Trailing return-type syntax fails with noexcept specifier?
  • Rails form posting to /new instead of /create?
  • F# code quotation invocation, performance, and run-time requirements
  • How to find out what changes on a branch after merges from master?
  • How to : get port number of AVD and send message to itself
  • XSLT Call-Template name attribute
  • What is the usage of jasperreports-javaflow?
  • Odd Error Importing DOT files
  • how to count all global variables in the cpp file
  • PHP Equivalent to Ruby's @instance_variable?
  • Why to use _form.html.erb in rails
  • How to extract element-path from XMLType Node?
  • Copy content of C variable into a register (GCC)
  • Working with location updates when app is terminated
  • How do I create an image and save it for later to draw as texture in XNA?
  • Parenthesis() and SQL Query Performance
  • Save image as is in photo album using swift
  • Any nice way to generate a timeline view of commits from subversion?
  • How to access meteor package name inside package?
  • How do I remove all but some records based on a threshold?
  • How to use Windows Media Foundation with UWP without a topology
  • CERN ROOT exporting data to plain text
  • JqueryMobile Popup menu is not working
  • Insert new calendar with SyncAdapter- Calendar API Android
  • MonoTouch: How to download pdf incrementally as indicated in the Apple slides “Building Newsstand Ap
  • Installed module is empty
  • Installing Apache MyFaces 2 on WildFly 8.2.0
  • Using jQuery closest() method with class selector
  • Installing Hadoop, Java Exception about illegal characters at index 7?
  • Master page gives error
  • Nant, Vault & Windows Integrated Authentication
  • Array.prototype.includes - not transformed with babel
  • Counter field in MS Access, how to generate?
  • recyclerView does not call the onBindViewHolder when scroll in the view
  • WinForms: two way TextBox problem
  • Javascript + PHP Encryption with pidCrypt
  • Websockets service method fails during R startup
  • Calling of Constructors in a Java
  • SVN: Merging two branches together
  • Traverse Array and Display in markup
  • VB.net deserialize, JSON Conversion from type 'Dictionary(Of String,Object)' to type '
  • Transpose CSV data with awk (pivot transformation)
  • Unable to use reactive element in my shiny app