sapling/tests/test-conflict-1.t
David M. Carr a6e63bd878 push: add more output about what was added (issue #64)
l33t pointed out that currently, Hg-Git doesn't provide any confirmation that a
push was successful other than the exit code.  Normal Mercurial provides a
couple other messages followed by "added X changesets with Y changes to
Z files".  After this change, Hg-Git will provide much more similar output.
It's not identical, as the underlying model is substantially different, but the
concept is the same.  The main message is "added X commits with Y trees and
Z blobs".

This change doesn't affect the output of what references/branches were touched.
That will be addressed in a subsequent commit.

Dulwich doesn't provide an easy hook to get the information needed for this
output.  Instead of passing generate_pack_contents as the pack generator
function to send_pack, I pass a custom function that determines the "missing"
objects, stores the counts, and then calls generate_pack_contents (which then
will determine the "missing" objects again.

The new expected output:
searching for changes # unless quiet true
<N> commits found     # if verbose true
list of commits:      # if debugflag true and at least one commit found
<each hash>           # if debugflag true and at least one commit found
adding objects        # if at least one commit found unless quiet true
added <N> commits with <N> trees and <N> blobs # if at least one object unless
                                               # quiet true

https://bitbucket.org/durin42/hg-git/issue/64/push-confirmation
2013-01-06 01:46:57 -05:00

74 lines
1.9 KiB
Perl

Load commonly used test logic
$ . "$TESTDIR/testutil"
$ hg init hgrepo1
$ cd hgrepo1
$ echo A > afile
$ hg add afile
$ hg ci -m "origin"
$ echo B > afile
$ hg ci -m "A->B"
$ hg up -r0
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo C > afile
$ hg ci -m "A->C"
created new head
$ hg merge -r1 2>&1 | sed 's/-C ./-C/' | egrep -v '^merging afile$' | sed 's/incomplete.*/failed!/'
warning: conflicts during merge.
merging afile failed!
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
resolve using first parent
$ echo C > afile
$ hg resolve -m afile
$ hg ci -m "merge to C"
$ hg log --graph --style compact | sed 's/\[.*\]//g'
@ 3:2,1 6c53bc0f062f 1970-01-01 00:00 +0000 test
|\ merge to C
| |
| o 2:0 ea82b67264a1 1970-01-01 00:00 +0000 test
| | A->C
| |
o | 1 7205e83b5a3f 1970-01-01 00:00 +0000 test
|/ A->B
|
o 0 5d1a6b64f9d0 1970-01-01 00:00 +0000 test
origin
$ cd ..
$ git init --bare gitrepo
Initialized empty Git repository in $TESTTMP/gitrepo/
$ cd hgrepo1
$ hg bookmark -r tip master
$ hg push -r master ../gitrepo
pushing to ../gitrepo
searching for changes
adding objects
added 4 commits with 3 trees and 3 blobs
$ cd ..
$ hg clone gitrepo hgrepo2 | grep -v '^updating'
importing git objects into hg
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
expect the same revision ids as above
$ hg -R hgrepo2 log --graph --style compact | sed 's/\[.*\]//g'
@ 3:1,2 6c53bc0f062f 1970-01-01 00:00 +0000 test
|\ merge to C
| |
| o 2:0 7205e83b5a3f 1970-01-01 00:00 +0000 test
| | A->B
| |
o | 1 ea82b67264a1 1970-01-01 00:00 +0000 test
|/ A->C
|
o 0 5d1a6b64f9d0 1970-01-01 00:00 +0000 test
origin