RFR [9] : get_source.sh should be more friendly to MQ
Chris Hegarty
chris.hegarty at oracle.com
Thu May 1 09:52:41 UTC 2014
John, Mike,
Thanks for your comments. I’ve been using rebase for a while now and it certainly makes resolving conflicts in patches much easier, as opposed to manually inspecting reject files. My workflow is as per your suggestion,
bash common/bin/hgforest.sh push -a
bash common/bin/hgforest.sh pull —rebase
Give that not everyone wants to operate this way, using rebase, I’m not sure what, if anything, can be added to get_source.sh to support this. Maybe I just need to omit get_source.sh from my workflow after the initial clone?
-Chris.
On 28 Apr 2014, at 20:43, John Coomes <John.Coomes at oracle.com> wrote:
> Chris Hegarty (chris.hegarty at oracle.com) wrote:
>> On 11/04/14 15:59, Jonathan Gibbons wrote:
>>> Popping all patches beforehand is reasonable, but afterwards, it would
>>> be better to reset to the patches that were previously applied than to
>>> try and push all of them.
>>
>> Michael as requested same.
>>
>>> What is the behavior if you cannot qpush patches after the pull, because
>>> of merge issues?
>>
>> The parts of the specific patch that applied cleanly remain applied,
>> them that did not are written out to reject files to be analyzed. The
>> remainder of the patches in that repository are not applied. get_source
>> will then exit with an appropriate error exit code and you can take action.
>
> [Sorry for resurrecting this thread, I just became aware of it--was not
> subscribed.]
>
> My workflow relies heavily on mq and (IMHO, of course) reject files
> are needless tedium. So I depend heavily on rebase. In order to
> avoid reject files when pulling, I do:
>
> hg qpush -a # push everything
>
> hg pull --rebase # pull and rebase in one step, will
> # invoke merge tools if necessary
>
> hg qpop <some_patch> # optional
>
> If you omit the 'hg qpush -a' before pulling, it becomes tedious
> (sometimes impossible) to get your merge tools invoked when you later
> want to push the patches.
>
> -John
>
>>> On 04/11/2014 07:58 AM, Chris Hegarty wrote:
>>>> Anyone using MQ for their daily development will know about this,
>>>> forgetting to qpop before sync'ing up. It would be nice it get_source
>>>> would pop and push patches ( only if you are using MQ ) automatically.
>>>> If you do not have patch repos, then there is no change.
>>>>
>>>> diff --git a/get_source.sh b/get_source.sh
>>>> --- a/get_source.sh
>>>> +++ b/get_source.sh
>>>> @@ -28,6 +28,21 @@
>>>> # Get clones of all nested repositories
>>>> sh ./common/bin/hgforest.sh clone "$@" || exit 1
>>>>
>>>> +patchdirs=`ls -d ./.hg/patches ./*/.hg/patches ./*/*/.hg/patches \
>>>> + ./*/*/*/.hg/patches ./*/*/*/*/.hg/patches 2>/dev/null`
>>>> +
>>>> +# Pop all patches, if any, before updating
>>>> +if [ "${patchdirs}" != "" ] ; then
>>>> + echo "Found queue repository, qpop."
>>>> + sh ./common/bin/hgforest.sh qpop -a || exit 1
>>>> +fi
>>>> +
>>>> # Update all existing repositories to the latest sources
>>>> -sh ./common/bin/hgforest.sh pull -u
>>>> +sh ./common/bin/hgforest.sh pull -u || exit 1
>>>>
>>>> +# Push all patches, if any, after updating
>>>> +if [ "${patchdirs}" != "" ] ; then
>>>> + echo "Found queue repository, qpush."
>>>> + sh ./common/bin/hgforest.sh qpush -a
>>>> +fi
>>>> +
>>>>
>>>> -Chris.
>>>
>
> --
> John Coomes Oracle, MS USCA22-3??
> john.coomes at oracle.com 4220 Network Circle
> 408-276-7048 Santa Clara, CA 95054-1778
> *** Support GreenPeace and we'll all breathe easier. ***
More information about the build-dev
mailing list