D469: rebase: initial support for multiple destinations

quark (Jun Wu) phabricator at mercurial-scm.org
Tue Aug 29 09:09:38 EDT 2017


quark added inline comments.

INLINE COMMENTS

> martinvonz wrote in rebase.py:822
> could pass ALLSRC in the fast-path version too, no? because the concern is not that that calcularing "allsrc" is costly, i assume, but that running the revset over all the revisions is

Good advice! I was focused on `SRC` and didn't consider the use-case where `ALLSRC` is used but not `SRC`. Will make fast path use it too.

> martinvonz wrote in rebase.py:824
> anyrevs() doesn't seem to make much sense here. Why not let localrepo.revs() and localrepo.set() accept "user" and "localalias" arguments too? I realize it's more code, but it seem to make more sense. Unless this is just temporary and you're planning on passing a longer list here later.

`repo.revs` docstring has:

  Revset aliases from the configuration are not expanded. To expand
  user aliases, consider calling ``scmutil.revrange()`` or
  ``repo.anyrevs([expr], user=True)``.

I think it makes sense to expend them. So `anyrevs` is used. I guess that's also why `any` is part of the method name.

IIUC, most user-provided revsets are expected to be consumed by `scmutil.revrange`, which uses `repo.anyrev`. So `anyrev` sounds like the right choice here.

----

For the example, see the test cases in the next patch. You need a more complex revset.

Defer resolving revsets could result in a much more complex patch (state file format, the order of obsmarker creation and bookmark movement need change). Performance may decline since we need to re-resolve and re-sort everything after every DAG change. I guess there are also more corner cases to handle (ex. `-d tip` may behave undesirably).

Note that even if you'd like to defer resolving destinations, it still need to know destinations first to decide which changesets to begin with (see the next patch). So the code here is still necessary.

I'd like we start simple.

> martinvonz wrote in test-rebase-dest.t:295
> Where is "map" defined?

Line 89.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D469

To: quark, #hg-reviewers
Cc: martinvonz, mercurial-devel


More information about the Mercurial-devel mailing list