问题
I have a site developed using Yii framework, and I want to upgrade the framework from version 1.1.8 to 1.1.11. I have made framework modifications that went into 1.1.11, but others didn't and I don't remember exactly which ones they are.
Is there a way to search for all the changes in a Mercurial repository made in a certain path? The framework sits in ./yiiframework directory.
回答1:
You can pass a path to the hg log
command:
hg log path/to/foo
回答2:
While @David answer is technically correct, it's wrong ideologically, and I'll answer on not-asked-question
"How to maintain my patches on top of changing upstream codebase"
which is really your business-task
For Mercurial this is rather easy job, where you perform only part of work "merge parallel changes", which can't be done automatically by SCM.
Short HowTo
- You use Mercurial repository
- You'll use at least 2 long-life named branches: "default" for upsteam code /if upstream is also hg/ or any other name for manually added upstream and, f.e. "My" branch for local patches
- Your repo can be started with upstream vanilla code of 1.1.8 (rev 1)
- You perform all your changes in WC on top of 1.1.8 and branch changed in My branch (rev 2)
- Return back to rev 1 and sync codebase with 1.1.11, commit to default branch (rev 3)
- Update to rev 2 and merge branches (default to My), resolve possible conflicts
After this actions your have 1.1.11 with changes inherited from your 1.1.8
Future workflow * Work on own branch only * Pull from upstream (if you can) into default or update default by hand * Merge into My, when it's needed
PS - More complex workflow may assume and admit using MQ-patches on top of single branch
来源:https://stackoverflow.com/questions/12875037/search-mercurial-repository-for-changes-in-a-certain-path