如果我一直在编写代码并忘记创建补丁系列,我该如何回顾性地创建补丁系列?到目前为止,唯一想到的是:
# Prepare and test the first batch of changes.
$ hg qrecord -m 'first batch' 1.patch
$ hg qnew -m 'stash downstream changes' stash-1.patch
$ hg qdelete -k temp-1.patch
$ make hello
cc hello.c -o hello
hello.c: In function ‘main’:
hello.c:4: error: syntax error at end of input
make: *** [hello] Error 1
$ echo '}' >> hello.c
$ make hello
cc hello.c -o hello
$ hg qrefresh
# Recover the stashed changes.
$ patch -p1 < .hg/patches/last.patch
# …Run Code Online (Sandbox Code Playgroud)