case study 1:
solo 或并发低的情况
hg init (or hg clone)
# mark up stream, or published rev
hg bookmark master
# create dev branch, a.k.a light-weight branch in git
hg bookmark dev-something
... hack
... hack
# record changes, it's okay to be unfinished
hg ci -m'wip: something part 1'
... hack
... hack
# record again
hg ci -m'wip: something part 2'
... hack
# it's done
hg ci -m'wip: something final part'
# edit history, it's all local, so it's safe
hg histedit -r"master::dev^"
# or if it's a clone
hg histedit --outgoing
... then fold all wip revs into one good-looking, final rev, with detail message
# check with upstream
hg up master
# pull in all upstream changes, update master
hg pull -u
合并方案有两种:merge 或 rebase
# Merge
hg merge
# delete now useless bookmark
hg bookmark -d dev
# Rebase, this results in a linear history, I prefer this
# back to local changes
hg up dev
# rebase dev onto master
hg rebase
# either way, it's ready to be published
hg push
git 的类似,用 branch 而不是 bookmark,用 interactive rebase 而不是 histedit
两者选用一种就行,没必要同一个 repos 两种来管理
我用 hg-git 只是因为我更喜欢用 hg,而 hg-git 是最简单的方式同一个 repos 可同时接受 hg 和 git 而已
solo 或并发低的情况
hg init (or hg clone)
# mark up stream, or published rev
hg bookmark master
# create dev branch, a.k.a light-weight branch in git
hg bookmark dev-something
... hack
... hack
# record changes, it's okay to be unfinished
hg ci -m'wip: something part 1'
... hack
... hack
# record again
hg ci -m'wip: something part 2'
... hack
# it's done
hg ci -m'wip: something final part'
# edit history, it's all local, so it's safe
hg histedit -r"master::dev^"
# or if it's a clone
hg histedit --outgoing
... then fold all wip revs into one good-looking, final rev, with detail message
# check with upstream
hg up master
# pull in all upstream changes, update master
hg pull -u
合并方案有两种:merge 或 rebase
# Merge
hg merge
# delete now useless bookmark
hg bookmark -d dev
# Rebase, this results in a linear history, I prefer this
# back to local changes
hg up dev
# rebase dev onto master
hg rebase
# either way, it's ready to be published
hg push
git 的类似,用 branch 而不是 bookmark,用 interactive rebase 而不是 histedit
两者选用一种就行,没必要同一个 repos 两种来管理
我用 hg-git 只是因为我更喜欢用 hg,而 hg-git 是最简单的方式同一个 repos 可同时接受 hg 和 git 而已


