I can't say I follow your version-management logic; what do different version numbers have to do with which changes you pull or merge? But if I understand you correctly, you want to modify the explicit version number in the stable
branch (say, to 6.1), then continue pushing changes to dev
but prevent the version number of dev
from becoming 6.1.
Here's how you do it: Make sure the version number is in its own changeset-- you don't want it sharing a changeset with changes that you do wish to apply. Now merge this changeset, telling mercurial to always use the "local" version of a file during the merge by means of a special "merge tool":
hg merge --tool internal:local -r REV
As hg help merge-tools
explains:
A merge tool combines two different versions of a file into a merged file.
...
"internal:local"
Uses the local version of files as the merged version.
See the full help for the details.
Merging revision REV
will also merge any changesets that REV
depends on. So you should first merge the revision immediately before REV
(in the normal way), if necessary. This could be automated with
hg merge -r 'parents(REV)'