tests/test-journal.t
changeset 29677 69890b5dd32b
parent 29675 12f04946053c
child 29679 e54bdd3aa23b
equal deleted inserted replaced
29676:c3a9cd78b151 29677:69890b5dd32b
   128   1e6c11564562  baz       book -r tip baz
   128   1e6c11564562  baz       book -r tip baz
   129   1e6c11564562  bar       up
   129   1e6c11564562  bar       up
   130   cb9a9f314b8b  bar       book -f bar
   130   cb9a9f314b8b  bar       book -f bar
   131   1e6c11564562  bar       book -r tip bar
   131   1e6c11564562  bar       book -r tip bar
   132 
   132 
   133 Test that verbose, JSON and commit output work
   133 Test that verbose, JSON, template and commit output work
   134 
   134 
   135   $ hg journal --verbose --all
   135   $ hg journal --verbose --all
   136   previous locations of the working copy and bookmarks:
   136   previous locations of the working copy and bookmarks:
   137   000000000000 -> 1e6c11564562 foobar    baz      1970-01-01 00:00 +0000  book -r tip baz
   137   000000000000 -> 1e6c11564562 foobar    baz      1970-01-01 00:00 +0000  book -r tip baz
   138   cb9a9f314b8b -> 1e6c11564562 foobar    bar      1970-01-01 00:00 +0000  up
   138   cb9a9f314b8b -> 1e6c11564562 foobar    bar      1970-01-01 00:00 +0000  up
   146   [
   146   [
   147    {
   147    {
   148     "command": "up",
   148     "command": "up",
   149     "date": "1970-01-01 00:00 +0000",
   149     "date": "1970-01-01 00:00 +0000",
   150     "name": ".",
   150     "name": ".",
   151     "newhashes": "1e6c11564562b4ed919baca798bc4338bd299d6a",
   151     "newhashes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"],
   152     "oldhashes": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b",
   152     "oldhashes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"],
   153     "user": "foobar"
   153     "user": "foobar"
   154    },
   154    },
   155    {
   155    {
   156     "command": "up 0",
   156     "command": "up 0",
   157     "date": "1970-01-01 00:00 +0000",
   157     "date": "1970-01-01 00:00 +0000",
   158     "name": ".",
   158     "name": ".",
   159     "newhashes": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b",
   159     "newhashes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"],
   160     "oldhashes": "1e6c11564562b4ed919baca798bc4338bd299d6a",
   160     "oldhashes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"],
   161     "user": "foobar"
   161     "user": "foobar"
   162    },
   162    },
   163    {
   163    {
   164     "command": "commit -Aqm b",
   164     "command": "commit -Aqm b",
   165     "date": "1970-01-01 00:00 +0000",
   165     "date": "1970-01-01 00:00 +0000",
   166     "name": ".",
   166     "name": ".",
   167     "newhashes": "1e6c11564562b4ed919baca798bc4338bd299d6a",
   167     "newhashes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"],
   168     "oldhashes": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b",
   168     "oldhashes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"],
   169     "user": "foobar"
   169     "user": "foobar"
   170    },
   170    },
   171    {
   171    {
   172     "command": "commit -Aqm a",
   172     "command": "commit -Aqm a",
   173     "date": "1970-01-01 00:00 +0000",
   173     "date": "1970-01-01 00:00 +0000",
   174     "name": ".",
   174     "name": ".",
   175     "newhashes": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b",
   175     "newhashes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"],
   176     "oldhashes": "0000000000000000000000000000000000000000",
   176     "oldhashes": ["0000000000000000000000000000000000000000"],
   177     "user": "foobar"
   177     "user": "foobar"
   178    }
   178    }
   179   ]
   179   ]
       
   180 
       
   181   $ cat <<EOF >> $HGRCPATH
       
   182   > [templates]
       
   183   > j = "{oldhashes % '{node|upper}'} -> {newhashes % '{node|upper}'}
       
   184   >      - user: {user}
       
   185   >      - command: {command}
       
   186   >      - newhashes: {newhashes}
       
   187   >      - oldhashes: {oldhashes}
       
   188   >      "
       
   189   > EOF
       
   190   $ hg journal -Tj -l1
       
   191   previous locations of '.':
       
   192   CB9A9F314B8B07BA71012FCDBC544B5A4D82FF5B -> 1E6C11564562B4ED919BACA798BC4338BD299D6A
       
   193   - user: foobar
       
   194   - command: up
       
   195   - newhashes: 1e6c11564562b4ed919baca798bc4338bd299d6a
       
   196   - oldhashes: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
       
   197 
   180   $ hg journal --commit
   198   $ hg journal --commit
   181   previous locations of '.':
   199   previous locations of '.':
   182   1e6c11564562  up
   200   1e6c11564562  up
   183   changeset:   1:1e6c11564562
   201   changeset:   1:1e6c11564562
   184   bookmark:    bar
   202   bookmark:    bar