Skip to content

Commit

Permalink
Ignore files and directories called .git
Browse files Browse the repository at this point in the history
Git cannot track these files. Print a warning if encountering one.

Fixes #166
  • Loading branch information
chrisjbillington committed Feb 7, 2020
1 parent ed36227 commit 8d135fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ hg-fast-export supports multiple branches but only named branches with
exactly one head each. Otherwise commits to the tip of these heads
within the branch will get flattened into merge commits.

hg-fast-export will ignore any files or directories tracked by mercurial
called `.git`, and will print a warning if it encounters one. Git cannot
track such files or directories. This is not to be confused with submodules,
which are described in README-SUBMODULES.md.

As each git-fast-import run creates a new pack file, it may be
required to repack the repository quite often for incremental imports
(especially when importing a small number of changesets per
Expand Down
3 changes: 3 additions & 0 deletions hg-fast-export.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ def export_file_contents(ctx,manifest,files,hgtags,encoding='',plugins={}):
filename=file.decode(encoding).encode('utf8')
else:
filename=file
if '.git' in filename.split(os.path.sep):
sys.stderr.write('Ignoring file %s which cannot be tracked by git\n' % filename)
continue
file_ctx=ctx.filectx(file)
d=file_ctx.data()

Expand Down

0 comments on commit 8d135fe

Please sign in to comment.