File: test-subrepos-drop.t

package info (click to toggle)
hg-git 1.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,244 kB
  • sloc: python: 8,702; sh: 185; makefile: 23
file content (68 lines) | stat: -rw-r--r-- 1,567 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
Load commonly used test logic
  $ . "$TESTDIR/testutil"

  $ cat >> $HGRCPATH <<EOF
  > [templates]
  > info =
  >   commit:  {rev}:{node|short}  {desc|fill68}
  >   added:   {file_adds}
  >   removed: {file_dels}\n
  > EOF

Create a Git upstream

  $ git init --quiet --bare repo.git


Create a Mercurial repository with a .gitmodules file:

  $ hg clone repo.git hgrepo
  updating to branch default
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ cd hgrepo
  $ hg book master
  $ touch this
  $ fn_hg_commit -A -m 'add this'
  $ cat > .gitmodules <<EOF
  > [submodule "subrepo"]
  > 	path = subrepo
  > 	url = ../gitsubrepo
  > EOF
  $ hg add .gitmodules
  $ fn_hg_commit -m "add .gitmodules file"
  $ cd ..

What happens if we push that to Git?

  $ hg -R hgrepo push
  pushing to $TESTTMP/repo.git
  warning: ignoring modifications to '.gitmodules' file; please use '.hgsub' instead
  searching for changes
  adding objects
  remote: found 0 deltas to reuse
  added 2 commits with 1 trees and 1 blobs
  adding reference refs/heads/master

But we don't get a warning if we don't touch .gitmodules:

  $ cd hgrepo
  $ touch that
  $ fn_hg_commit -A -m 'add that'
  $ hg push
  pushing to $TESTTMP/repo.git
  searching for changes
  adding objects
  remote: found 0 deltas to reuse
  added 1 commits with 1 trees and 0 blobs
  updating reference refs/heads/master
  $ cd ..

Check that it didn't silenty come through, or something:

  $ git clone repo.git gitrepo
  Cloning into 'gitrepo'...
  done.
  $ ls -A gitrepo
  .git
  that
  this