RFR [9] : get_source.sh should be more friendly to MQ
John Coomes
John.Coomes at oracle.com
Mon Apr 28 19:53:40 UTC 2014
Mike Duigou (mike.duigou at oracle.com) wrote:
>
> On Apr 11 2014, at 12:06 , Chris Hegarty <chris.hegarty at oracle.com> wrote:
>
> > On 11 Apr 2014, at 18:55, Mike Duigou <mike.duigou at oracle.com> wrote:
> >
> >> Have you looked at using rebase?
> >
> > I have not, in any detail.
> >
> >> I've been using
> >>
> >> sh common/bin/hgforest.sh pull
> >> sh common/bin/hgforest.sh rebase
> >> sh common/bin/hgforest.sh update
> >>
> >> rather than get_source.sh as it allows me to skip the qpop/qpush steps.
> >
> > Yes, this may work. I was just looking for a single command to active this. Maybe this combination could be baked into get_source.sh if patch repositories exist, and we can verify the existence of the rebase extension ( rather than my previous proposal ) ?
>
> I have contemplated adding this as an alternative to the pull -u step in get_source.sh but wasn't others would agree. Some people hate rebase.
>
> We can detect whether rebase is enabled via :
>
> hg showconfig extensions | grep ^extension.rebase | wc -l
>
> Play with this approach manually and see if it works for you. If it does then we can consider enhancing get_source.sh
'hg pull --rebase' is the equivalent of pull + update + rebase, and
you should already be able to run 'hgforest.sh pull --rebase'
(although I haven't tried it).
I'd be wary of trying to run rebase automatically, without an
indication that's what the user wants.
-John
> > -Chris.
> >
> >>
> >> Mike
> >>
> >> On Apr 11 2014, at 07:58 , Chris Hegarty <chris.hegarty at oracle.com> 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