New stg command: assimilate
authorKarl Hasselström <kha@treskal.com>
Wed, 25 Oct 2006 19:24:55 +0000 (20:24 +0100)
committerCatalin Marinas <catalin.marinas@gmail.com>
Wed, 25 Oct 2006 19:24:55 +0000 (20:24 +0100)
commit4d0ba818236453fae51c9efb64950f23557cc428
treeb9b6a4675274e651867518e1b123959e29f5dc80
parenta9d82c361e1923fc487ec06d4fa091ef1511732a
New stg command: assimilate

Introduce an "assimilate" command, with no options. It takes any GIT
commits committed on top of your StGIT patch stack and converts them
into StGIT patches.

Also change the error message when an StGIT command can't do its job
because there are GIT commits on top of the stack. Instead of
recommending "refresh -f", which is a destructive operation, recommend
"assimilate", which is not.

NOTE: "assimilate" currently refuses to work its magic if it
encounters a merge commit. This is reasonable, since merge commits
can't (yet) be represented as StGIT patches. However, it would be
possible (and well-defined) to replace the merge commit with a regular
commit on the branch with the same end result (tree object),
discarding all the parents that aren't on our branch. But this would
take a substantial amount of code, and is of dubious value, so for now
"assimilate" just cries bloody murder if it finds a merge.

Signed-off-by: Karl Hasselström <kha@treskal.com>
stgit/commands/assimilate.py [new file with mode: 0644]
stgit/commands/common.py
stgit/git.py
stgit/main.py
stgit/stack.py