tell update to run only if there are no conflicts

Benjamin Fritz fritzophrenic at gmail.com
Tue Apr 14 14:25:20 UTC 2015


On Mon, Apr 13, 2015 at 4:22 AM, Lasse Kliemann <lasse at lassekliemann.de>
wrote:
>
> Kastner Masilko, Friedrich <kastner-masilko at at.festo.com> writes:
>
> >> So I would prefer:
> >>
> >> hg pull
> >> hg update --only-if-no-conflicts
> >> hg commit
> >> hg push -f
>
> > What should happen between the second and third line when a conflict
> > arises? Auto-commit and merge triggering, so your third line will
> > commit the merge? Or simply revert cleanly and restore, so your third
> > line will commit the new head?
>
> The second line (update) should progess as far as possbile on the path
> From _parent_ to _tip_. If it has updated to changeset n on that path
> and n+1 causes a conflict, then the working copy should reflect n (plus
> the local changes). Then the local changes are committed by line 3.
>
> By the way, I think this is (roughly) equivalent to first commiting and
> then rebasing the new commit on changeset n.
>

I think it would be far more predictable, with fewer chances of breaking
things, if "hg update --only-if-no-conflicts" was a no-op when conflicts
arise. Then "hg commit" would create a new head with a parent of whatever
the current working copy's parent happens to be.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20150414/efc93bdd/attachment-0002.html>


More information about the Mercurial mailing list