Sanity Checks

Initialization

$ hg init sanity
$ cd sanity
$ cat >.hg/pgraph <<-eof
    a: b
    b: a
eof
$ hg pgraph
abort: patch dependency cycle detected involving b and a
$ cd ..

Empty Repos

See Issue 35.

$ hg init empty
$ cd empty
$ hg pnew one
marked working directory as branch one
(branches are permanent and global, did you want a bookmark?)
$ hg pgraph -tns
@  [one]
|
o  default
$ hg pnew two
marked working directory as branch two
(branches are permanent and global, did you want a bookmark?)
$ hg up one
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ echo a >a
$ hg ci -Ama
adding a
$ hg pgraph -tns
o  [two]
|   * needs merge with one
|   * needs update of diff base to tip of one
@  [one]
|
o  default
$ hg pmerge
$ hg pmerge two
two: merging from one
marked working directory as branch two
(branches are permanent and global, did you want a bookmark?)
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd ..

Editing Messages

Edit Non-Current Message

$ hg init peditmsg
$ cd peditmsg
$ hg pnew one
marked working directory as branch one
(branches are permanent and global, did you want a bookmark?)
$ hg pnew two
marked working directory as branch two
(branches are permanent and global, did you want a bookmark?)
$ hg peditmessage two -t "zwei" 
$ hg peditmessage one -t "eins" 
created new head
$ hg glog
o  3    one: update patch description - john
|
| @  2    two: update patch description - john
| |
| o  1    two: start new patch on one - john
|/
o  0    one: start new patch on default - john
$ hg pgraph -m
@  zwei
|
o  eins
|
o  default

Edit Already Modified Message

See Issue 31.

$ echo More >>.hgpatchinfo/two.desc
$ cat .hgpatchinfo/two.desc
zweiMore
$ hg peditmessage # editor is set to "cat" 
zweiMore
$ hg pmessage
zweiMore
$ cd ..

Use Custom Commit Message

$ hg init custommsg
$ cd custommsg
$ hg pnew one
marked working directory as branch one
(branches are permanent and global, did you want a bookmark?)
$ hg peditmessage -t "eins" -m "updated desc" 
$ hg log
1    one: updated desc - john
0    one: start new patch on default - john
$ cd ..