Re: [PATCH RFC] git-remote-mediawiki: push-by-rev
From: Matthieu Moy <hidden>
Date: 2016-06-15 22:57:46
Célestin Matte [off-list ref] writes:
This uses subroutines used by the fetch-by-rev strategy. I'm not sure it's actually complete: can it be that simple?
The function says:
# Get the last remote revision without taking in account which pages are
# tracked or not. This function makes a single request to the wiki thus
# avoid a loop onto all tracked pages. This is useful for the fetch-by-rev
# option.
sub get_last_global_remote_rev {
...
So I don't think this would work when you track only a subset of pages.
If an untracked page has been modified, then the global last revision
has increased and you'll get a non-fast forward. If you try to pull,
it'll tell you there's nothing to import.
You'd have to iterate through revisions between the one given by
get_last_global_remote_rev and the last one the local repo knows about,
and remove ones touching untracked pages from the list.
However, I tested on a local wiki and it seemed to work perfectly. Should I add associate tests?
See what t/t9364-pull-by-rev.sh does. You can set pushStrategy too in the same file (this won't test all push/pull combinations, but push and pull should be independant enough, so testing both unset and both set should be enough). Not sure we have enough test for push with a subset of pages though. -- Matthieu Moy http://www-verimag.imag.fr/~moy/