script suggestions

Giorgos Keramidas keramida at ceid.upatras.gr
Sat Jan 23 03:20:43 CST 2010


On Sat, 23 Jan 2010 22:05:33 +1300, mp3geek <mp3geek at gmail.com> wrote:
> so hg add should be the first command then? like so? (sorry for being a noob
> here)
>
> #!/bin/bash
> hg add .
> hg update
> hg pull --rebase remote
> hg pull
> hg commit -m "$1"
> hg push

Almost 'ok' but still a dangerous script.

My recommendation is still *NOT* to use this small script to do real
work though.  It gives the illusion of being "featureful" and "making
things easier" but it includes traps for the unwary that are far worse
than doing things manually.

For example:

  * You are using "hg add" but still pulling stuff *before* the newly
    added files are safely committed.

  * You are rebasing and then pulling *again* but the second pull does
    not rebase, so you may still end up with multiple heads.

  * You are pushing stuff automatically, from a script, that nobody has
    checked.  This will one day push broken changes and you will have to
    go and cleanup the mess after the script.

What is the _real_ problem you are trying to solve?  Posting all the
possible ways that this script can screw up is not a constructive way of
moving forward.  Please let us know what you are trying to _achieve_ and
we may be able to help you find a more constructive way of going at it.



More information about the Mercurial mailing list