Show More
@@ -61,9 +61,14 b' class convert_git(converter_source):' | |||
|
61 | 61 | self.modecache = {} |
|
62 | 62 | fh = self.gitcmd("git-diff-tree --root -m -r %s" % version) |
|
63 | 63 | changes = [] |
|
64 | seen = {} | |
|
64 | 65 | for l in fh: |
|
65 |
if "\t" not in l: |
|
|
66 | if "\t" not in l: | |
|
67 | continue | |
|
66 | 68 | m, f = l[:-1].split("\t") |
|
69 | if f in seen: | |
|
70 | continue | |
|
71 | seen[f] = 1 | |
|
67 | 72 | m = m.split() |
|
68 | 73 | h = m[3] |
|
69 | 74 | p = (m[1] == "100755") |
@@ -5,15 +5,42 b'' | |||
|
5 | 5 | echo "[extensions]" >> $HGRCPATH |
|
6 | 6 | echo "convert=" >> $HGRCPATH |
|
7 | 7 | |
|
8 | GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME | |
|
9 | GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL | |
|
10 | GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE | |
|
11 | GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME | |
|
12 | GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL | |
|
13 | GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE | |
|
14 | ||
|
15 | count=10 | |
|
16 | commit() | |
|
17 | { | |
|
18 | GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000" | |
|
19 | GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE" | |
|
20 | git commit "$@" >/dev/null 2>/dev/null || echo "git commit error" | |
|
21 | count=`expr $count + 1` | |
|
22 | } | |
|
23 | ||
|
8 | 24 | mkdir git-repo |
|
9 | 25 | cd git-repo |
|
10 | 26 | git init-db >/dev/null 2>/dev/null |
|
11 | 27 | echo a > a |
|
12 | 28 | git add a |
|
13 | git commit -m t1 >/dev/null 2>/dev/null || echo "git commit error" | |
|
29 | commit -m t1 | |
|
30 | ||
|
14 | 31 | echo b >> a |
|
15 | git commit -a -m t2 >/dev/null || echo "git commit error" | |
|
32 | commit -a -m t2.1 | |
|
33 | ||
|
34 | git checkout -b other HEAD^ >/dev/null 2>/dev/null | |
|
35 | echo c > a | |
|
36 | echo a >> a | |
|
37 | commit -a -m t2.2 | |
|
38 | ||
|
39 | git checkout master >/dev/null 2>/dev/null | |
|
40 | git pull --no-commit . other > /dev/null 2>/dev/null | |
|
41 | commit -m 'Merge branch other' | |
|
16 | 42 | cd .. |
|
17 | 43 | |
|
18 | hg convert git-repo | |
|
44 | hg convert --datesort git-repo | |
|
19 | 45 | |
|
46 | hg -R git-repo-hg tip -v |
@@ -3,5 +3,20 b' initializing destination git-repo-hg rep' | |||
|
3 | 3 | scanning source... |
|
4 | 4 | sorting... |
|
5 | 5 | converting... |
|
6 |
|
|
|
7 |
|
|
|
6 | 3 t1 | |
|
7 | 2 t2.1 | |
|
8 | 1 t2.2 | |
|
9 | 0 Merge branch other | |
|
10 | changeset: 3:f0873470732d | |
|
11 | tag: tip | |
|
12 | parent: 1:cb991dbbb06b | |
|
13 | parent: 2:600bef931ca4 | |
|
14 | user: test <test@example.org> | |
|
15 | date: Mon Jan 01 00:00:13 2007 +0000 | |
|
16 | files: a | |
|
17 | description: | |
|
18 | Merge branch other | |
|
19 | ||
|
20 | committer: test <test@example.org> | |
|
21 | ||
|
22 |
General Comments 0
You need to be logged in to leave comments.
Login now