In the good old days of Subversion, I sometimes outputted a new file from an existing one using svn copy . Then, if something changed in the partitions that they shared, I could use svn merge to update the derived version.
To use the hginit.com example, let's say that the โguacโ recipe already exists, and I want to create a โsuperguacโ that includes instructions on how to serve guacamole to thousands of crazy football fans. Using the process just described, I could:
svn cp guac superguac svn ci -m "Created superguac by copying guac" (edit superguac) svn ci -m "Added instructions for serving 1000 raving soccer fans to superguac" (edit guac) svn ci -m "Fixed a typo in guac" svn merge -r3:4 guac superguac
and thus the typo correction will be applied to superguac.
Mercurial provides an hg copy command that marks the file as a copy of the original, but I'm not sure if the repository structure supports a similar workflow. Here is the same example, and I carefully edit only one file in the commit that I want to use in the merge:
hg cp guac superguac hg ci -m "Created superguac by copying guac" (edit superguac) hg ci -m "Added instructions for serving 1000 raving soccer fans to superguac" (edit guac) hg ci -m "Fixed a typo in guac"
Now I want to apply the changes in guac to superguac. Is it possible? If so, what is the right team? Is there any other workflow in Mercurial that achieves the same results (limited to one branch)?
mercurial
Stephen
source share