これには Mercurial パッチは必要ありません。プルするときにコミットされていない未解決の変更がある場合、それらはヒントにマージされます。
例:
C:\>hg init db
C:\>cd db
C:\db>echo >file1
C:\db>echo >file2
C:\db>echo >file3
C:\db>hg ci -Am codebase # Create a code base with 3 files.
adding file1
adding file2
adding file3
C:\db>echo a change >>file2 # Outstanding change to file2.
C:\db>hg st
M file2
この時点で、データベースのクローンを作成し、プルできる変更をコミットします。
C:\db>hg clone . \db2
updating to branch default
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
C:\db>cd \db2
C:\db2>echo a change >>file3
C:\db2>hg ci -m "file3 change" # Commit a change to file3.
元のデータベースに戻る...
C:\db2>cd \db
C:\db>hg st # Still have uncommitted change
M file2
C:\db>hg pull \db2
pulling from \db2
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
(run 'hg update' to get a working copy)
C:\db>hg st # We have the new history, but haven't updated.
M file2 # file2 has uncommitted change.
C:\db>type file3 # file3 is unchanged.
ECHO is on.
C:\db>hg update
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
C:\db>hg st # We've updated, and file2 *still* has
M file2 # uncommitted change.
C:\db>type file2
ECHO is on.
a change
C:\db>type file3 # But file3 now has committed change
ECHO is on. # that was pulled.
a change
したがって、コミットされていない変更であっても、プルして更新するだけでよいというのが教訓です。マージの競合がある場合、通常のマージ動作も発生します。
パッチのエクスポートhg export <rev>
では、レビュー用にパッチがエクスポートされます。