05
Sep
11

mercurial fold commits


Practical example of folding three commits into one. For this to work, commits should not have been pushed.


D:\test\hgt>hg init

D:\test\hgt>touch one

D:\test\hgt>hg add .

adding one

D:\test\hgt>hg commit -m one

D:\test\hgt>touch second

D:\test\hgt>hg add .

adding second

D:\test\hgt>hg commit -m second

D:\test\hgt>hg log

changeset:   1:6ac539119ec9
tag:         tip
user:        John
date:        Mon Sep 05 00:06:03 2011 +0300
summary:     second

changeset:   0:60aac1a7734b
user:        John
date:        Mon Sep 05 00:05:56 2011 +0300
summary:     one

D:\test\hgt>ls
one  second

D:\test\hgt>touch third

D:\test\hgt>hg add .

adding third

D:\test\hgt>hg commit -m third

D:\test\hgt>hg qimport -r0:tip
D:\test\hgt>hg qser

0.diff
1.diff
2.diff

D:\test\hgt>hg qpop -a

popping 2.diff
popping 1.diff
popping 0.diff
patch queue now empty

D:\test\hgt>hg qpush 0.diff

applying 0.diff
now at: 0.diff

D:\test\hgt>hg qfold 1.diff


D:\test\hgt>hg qfold 2.diff


D:\test\hgt>hg qser

0.diff

D:\test\hgt>hg qref -m "One,two and three"


D:\test\hgt>hg qfinish 0.diff


D:\test\hgt>hg log

changeset:   0:93524a39039d
tag:         tip
user:        John
date:        Mon Sep 05 00:05:56 2011 +0300
summary:     One,two and three

Advertisements

0 Responses to “mercurial fold commits”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Blog Stats

  • 228,134 hits

%d bloggers like this: