File: test-incoming.t

package info (click to toggle)
hg-git 0.8.12-1%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 876 kB
  • sloc: python: 6,248; sh: 102; makefile: 32
file content (137 lines) | stat: -rw-r--r-- 3,797 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
Load commonly used test logic
  $ . "$TESTDIR/testutil"

  $ git init gitrepo
  Initialized empty Git repository in $TESTTMP/gitrepo/.git/
  $ cd gitrepo
  $ echo alpha > alpha
  $ git add alpha
  $ fn_git_commit -m "add alpha"

  $ cd ..
  $ hg init hgrepo-empty
  $ hg -R hgrepo-empty incoming gitrepo | grep -v 'no changes found'
  comparing with gitrepo
  changeset:   0:7eeab2ea75ec
  bookmark:    master
  user:        test <test@example.org>
  date:        Mon Jan 01 00:00:10 2007 +0000
  summary:     add alpha
  

  $ hg clone gitrepo hgrepo | grep -v '^updating'
  importing git objects into hg
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved

  $ hg -R hgrepo incoming | grep -v 'no changes found'
  comparing with $TESTTMP/gitrepo

  $ cd gitrepo
  $ echo beta > beta
  $ git add beta
  $ fn_git_commit -m 'add beta'
  $ cd ..

  $ hg -R hgrepo incoming | grep -v 'no changes found'
  comparing with $TESTTMP/gitrepo
  changeset:   1:9497a4ee62e1
  bookmark:    master
  user:        test <test@example.org>
  date:        Mon Jan 01 00:00:11 2007 +0000
  summary:     add beta
  

  $ cd gitrepo
  $ git checkout -b b1 HEAD^
  Switched to a new branch 'b1'
  $ mkdir d
  $ echo gamma > d/gamma
  $ git add d/gamma
  $ fn_git_commit -m'add d/gamma'
  $ git tag t1

  $ echo gamma 2 >> d/gamma
  $ git add d/gamma
  $ fn_git_commit -m'add d/gamma line 2'
  $ cd ../hgrepo
  $ hg incoming -p | grep -v 'no changes found'
  comparing with $TESTTMP/gitrepo
  changeset:   1:9497a4ee62e1
  bookmark:    master
  user:        test <test@example.org>
  date:        Mon Jan 01 00:00:11 2007 +0000
  summary:     add beta
  
  diff -r ff7a2f2d8d70 -r 9497a4ee62e1 beta
  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
  +++ b/beta	Mon Jan 01 00:00:11 2007 +0000
  @@ -0,0 +1,1 @@
  +beta
  
  changeset:   2:9865e289be73
  tag:         t1
  parent:      0:ff7a2f2d8d70
  user:        test <test@example.org>
  date:        Mon Jan 01 00:00:12 2007 +0000
  summary:     add d/gamma
  
  diff -r ff7a2f2d8d70 -r 9865e289be73 d/gamma
  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
  +++ b/d/gamma	Mon Jan 01 00:00:12 2007 +0000
  @@ -0,0 +1,1 @@
  +gamma
  
  changeset:   3:5202f48c20c9
  bookmark:    b1
  user:        test <test@example.org>
  date:        Mon Jan 01 00:00:13 2007 +0000
  summary:     add d/gamma line 2
  
  diff -r 9865e289be73 -r 5202f48c20c9 d/gamma
  --- a/d/gamma	Mon Jan 01 00:00:12 2007 +0000
  +++ b/d/gamma	Mon Jan 01 00:00:13 2007 +0000
  @@ -1,1 +1,2 @@
   gamma
  +gamma 2
  

incoming -r
  $ hg incoming -r master | grep -v 'no changes found'
  comparing with $TESTTMP/gitrepo
  changeset:   1:9497a4ee62e1
  bookmark:    master
  user:        test <test@example.org>
  date:        Mon Jan 01 00:00:11 2007 +0000
  summary:     add beta
  
  $ hg incoming -r b1 | grep -v 'no changes found'
  comparing with $TESTTMP/gitrepo
  changeset:   1:9865e289be73
  tag:         t1
  user:        test <test@example.org>
  date:        Mon Jan 01 00:00:12 2007 +0000
  summary:     add d/gamma
  
  changeset:   2:5202f48c20c9
  bookmark:    b1
  user:        test <test@example.org>
  date:        Mon Jan 01 00:00:13 2007 +0000
  summary:     add d/gamma line 2
  
  $ hg incoming -r t1 | grep -v 'no changes found'
  comparing with $TESTTMP/gitrepo
  changeset:   1:9865e289be73
  tag:         t1
  user:        test <test@example.org>
  date:        Mon Jan 01 00:00:12 2007 +0000
  summary:     add d/gamma
  

nothing incoming after pull
"adding remote bookmark" message was added in Mercurial 2.3
  $ hg pull | grep -v "adding remote bookmark"
  pulling from $TESTTMP/gitrepo
  importing git objects into hg
  (run 'hg heads' to see heads, 'hg merge' to merge)
  $ hg incoming | grep -v 'no changes found'
  comparing with $TESTTMP/gitrepo