-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mononoke: order prefix map by length in movers
Summary: In the future we may want to allow non-prefix-free prefix maps for x-repo sync, like this: ``` a/ => c/ a/b => d/ ``` In the current `mover_factory` implementation the way a path like `a/b/hello` is rewritten depends on which prefix map entry we hit first during iteration, as both of them match, so we may produce the incorrect rewrite into `c/b/hello` instead of `d/hello`. This can be dealt with if we consider prefixes in the longer-to-shorter order. NB: currently non-prefix-free maps are prohibited and I would like it to stay this way so far, as not all of the problems with them are understood. Introducing an additional sorting for `mover` creation is not going to harm anything, so let's just do it. Reviewed By: farnz Differential Revision: D19023924 fbshipit-source-id: d4bd8fbd80d35650aae94da624d8ec6f22c842f4
- Loading branch information
1 parent
8e06031
commit e9df42c
Showing
1 changed file
with
56 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters