Re: [PATCH RFC] git-remote-mediawiki: push-by-rev
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Jun 16, 2013, 20:49 UTC
- Message-ID
- <vpq8v29eq7n.fsf@anie.imag.fr>
- In-Reply-To
- <1371414499-13027-1-git-send-email-celestin.matte@ensimag.fr>
Célestin Matte <celestin.matte@ensimag.fr> 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/