dan gibson
dan gibson

Reputation: 3665

Using mercurial to track readme file across multiple versions

I have version 1 of a project with a readme.txt file.

I clone my version 1 repo as version 2 so I can pull any bug fixes from v1 into v2.

v1 and v2 both have a readme.txt file, but it is completely different. Changes to v1 readme shouldn't affect v2 during the pull.

I tried doing hg remove readme.txt in v2 but every time I pull I have to merge it.

The basic problem is that I delete a file in v2 and change it in v1. I don't want the pull to bring in that deleted file.

What do other people normally do for readme type files with mercurial?

Upvotes: 1

Views: 59

Answers (1)

almostflan
almostflan

Reputation: 640

Mercurial deals in changesets so what you're saying is inherently difficult. You'll just have to deal with merge conflicts each time you merge v1 -> v2. That said, it should be fairly easy if you know you always want to take the v2 version.

Might even be possible to do something like this if v2 is a long-lived branch and README changes often in both branches.

This goes in your .bashrc

alias merge_v1="hg merge v1 && [[ -e \"README.orig\" ]] && mv README.orig README && hg resolve --mark README"

Note: I haven't tested this.

Upvotes: 1

Related Questions