您实际上并不需要 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> 将导出补丁供审核。