Checking for conflicts before merge
Kevin Bullock
kbullock+mercurial at ringworld.org
Wed Nov 9 17:52:43 UTC 2016
> On Nov 9, 2016, at 02:55, akos tajti <akos.tajti at gmail.com> wrote:
>
> Hi All,
>
> my problem: I have a repository with many forks. The forks are automatically merged to the blessed repo. I need to somehow check if merging a specific fork would introduce conflicts. I came up with this command sequence:
>
> * I run this in the blessed repo: hg incoming -b default --bundle /tmp/incoming.bundle FORK_URL (this will create a bundle with the incoming changesets)
> * then, again in the blessed repo, I run this command: hg -R /tmp/incoming.bundle merge -r tip -y --config ui.merge=internal:fail . this will show me the number of unresolved files (0, when there is no conflict)
> * so far so good. My problem is that after these commands I have to clean the repository (hg update -C . )
>
> Is there a better solution for this. I don't really like the idea of running hg update programmatically.
For the second step, you could try:
$ hg -R /tmp/incoming.bundle merge --preview
Or you could create a throwaway clone and do your checks there. Local clones use hardlinks where possible and are therefore relatively cheap (the working directory files don't use hardlinks, so you would still have to pay the time and space cost of a checkout).
pacem in terris / мир / शान्ति / سَلاَم / 平和
Kevin R. Bullock
More information about the Mercurial
mailing list