rebase message confusion
Sune Foldager
cryo at cyanite.org
Wed Oct 7 14:37:48 CDT 2009
I am trying to fix a bug in hg rebase, which occurs in some cases when
you try to rebase from a certain point to a descendant of that point;
you get a cryptic error and the wdir parent is changed.
Before I can do that, however, I had to make sense of what I consider at
best highly confusing status, debug and error messages from hg rebase.
For instace, what does this mean?
"cannot rebase an ancestor"
well it makes you think at least. I am trying to rebase x to an ancestor
of x? or to a descendant of x? the latter is correct. But why not the
much clearer "source is ancestor of destination"?
Similar with the opposite, "cannot rebase a descendant". A descendant of
what?? Here I would prefer "source is a descendant of destination",
analogous to the previous case.
These messages are actually aborts, so the process stops with an error.
And this happens when the --source option is used. If either --base or
no source selection option is used, an entirely different code path is
activated, for some reason, with other, even worse, messages. This time
they are debug messages, and the command succeeds with "nothing to
rebase" instead of aborting.
For instance, we have the great message "already working on current"....
which means... source == destination! why, of course :-)
And what on earth does "already working on branch" mean?? Well, as it
turns out it means the same as "cannot rebase an ancestor", that is it
means "source is ancestor of destination".
Now, my bug fix needs to output the opposite message of the above, which
is why I write this. Because I find it hard to create the opposite of
"already working on branch" :-p.
So does anyone know why a) we would want these somewhat cryptic
messages? and b) why we sometimes want to abort, and sometimes to
ui.debug and otherwise fail almost silently? I hope we can agree on some
nice messages; suggestions are very welcome :-).
/Sune
(Another issue is the documentation of --source and --base, which IMHO
fail to make it clear what they each do. But well, that's another issue
:-).)
More information about the Mercurial-devel
mailing list