Mercurial > hg-git
comparison hggit/git2hg.py @ 1116:bd1a01f98154
cleanup: wrap to 80 chars
author | Sean Farley <sean@farley.io> |
---|---|
date | Mon, 27 Nov 2017 19:05:08 -0500 |
parents | 8ed6c0cae9b8 |
children |
comparison
equal
deleted
inserted
replaced
1115:8ed6c0cae9b8 | 1116:bd1a01f98154 |
---|---|
5 | 5 |
6 | 6 |
7 def find_incoming(git_object_store, git_map, refs): | 7 def find_incoming(git_object_store, git_map, refs): |
8 '''find what commits need to be imported | 8 '''find what commits need to be imported |
9 | 9 |
10 git_object_store is a dulwich object store. | 10 git_object_store: is a dulwich object store. |
11 git_map is a map with keys being Git commits that have already been imported | 11 git_map: is a map with keys being Git commits that have already been |
12 refs is a map of refs to SHAs that we're interested in.''' | 12 imported |
13 refs: is a map of refs to SHAs that we're interested in. | |
14 | |
15 ''' | |
13 | 16 |
14 done = set() | 17 done = set() |
15 commit_cache = {} | 18 commit_cache = {} |
16 | 19 |
17 # sort by commit date | 20 # sort by commit date |
86 split = message.split("\n--HG--\n", 1) | 89 split = message.split("\n--HG--\n", 1) |
87 # Renames are explicitly stored in Mercurial but inferred in Git. For | 90 # Renames are explicitly stored in Mercurial but inferred in Git. For |
88 # commits that originated in Git we'd like to optionally infer rename | 91 # commits that originated in Git we'd like to optionally infer rename |
89 # information to store in Mercurial, but for commits that originated in | 92 # information to store in Mercurial, but for commits that originated in |
90 # Mercurial we'd like to disable this. How do we tell whether the commit | 93 # Mercurial we'd like to disable this. How do we tell whether the commit |
91 # originated in Mercurial or in Git? We rely on the presence of extra hg-git | 94 # originated in Mercurial or in Git? We rely on the presence of extra |
92 # fields in the Git commit. | 95 # hg-git fields in the Git commit. |
93 # - Commits exported by hg-git versions past 0.7.0 always store at least one | 96 # |
94 # hg-git field. | 97 # - Commits exported by hg-git versions past 0.7.0 always store at least |
98 # one hg-git field. | |
99 # | |
95 # - For commits exported by hg-git versions before 0.7.0, this becomes a | 100 # - For commits exported by hg-git versions before 0.7.0, this becomes a |
96 # heuristic: if the commit has any extra hg fields, it definitely originated | 101 # heuristic: if the commit has any extra hg fields, it definitely |
97 # in Mercurial. If the commit doesn't, we aren't really sure. | 102 # originated in Mercurial. If the commit doesn't, we aren't really sure. |
103 # | |
98 # If we think the commit originated in Mercurial, we set renames to a | 104 # If we think the commit originated in Mercurial, we set renames to a |
99 # dict. If we don't, we set renames to None. Callers can then determine | 105 # dict. If we don't, we set renames to None. Callers can then determine |
100 # whether to infer rename information. | 106 # whether to infer rename information. |
101 renames = None | 107 renames = None |
102 extra = {} | 108 extra = {} |