annotate hgext3rd/fastimport/vendor/python_fastimport/__init__.py @ 86:28704a2a7461 vendor/python-fastimport

Import python-fastimport-0.9.8
author Roy Marples <roy@marples.name>
date Tue, 19 Jan 2021 22:56:34 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
86
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
1 # Copyright (C) 2008-2011 Canonical Ltd
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
2 #
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
3 # This program is free software; you can redistribute it and/or modify
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
4 # it under the terms of the GNU General Public License as published by
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
5 # the Free Software Foundation; either version 2 of the License, or
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
6 # (at your option) any later version.
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
7 #
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
8 # This program is distributed in the hope that it will be useful,
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
11 # GNU General Public License for more details.
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
12 #
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
13 # You should have received a copy of the GNU General Public License
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
15
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
16 """Fastimport file format parser and generator
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
17
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
18 This is a Python parser for git's fast-import format. It was
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
19 originally developed for bzr-fastimport but has been extracted so
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
20 it can be used by other projects. Use it like so:
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
21
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
22 import fastimport.processor
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
23 import fastimport.parser
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
24
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
25 class ImportProcessor(fastimport.processor.ImportProcessor):
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
26 ...
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
27
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
28 parser = fastimport.parser.ImportParser(sys.stdin)
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
29 processor = ImportProcessor(...)
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
30 processor.process(parser.parse())
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
31 """
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
32
28704a2a7461 Import python-fastimport-0.9.8
Roy Marples <roy@marples.name>
parents:
diff changeset
33 __version__ = (0, 9, 8)