Package gbp :: Package git :: Module fastimport :: Class FastImport

[hide private]
[frames] | no frames]

# Class FastImport

    object --+
             |
            FastImport

Add data to a git repository using git fast-import

Instance Methods | [hide private]

__init__(self, repo) x.__init__(...) initializes x; see help(type(x)) for signature |

_do_data(self, fd, size) |

_do_file(self, filename, mode, fd, size) |

add_file(self, filename, fd, size, mode=644) Add a file |

add_symlink(self, linkname, linktarget) Add a symlink |

start_commit(self, branch, committer, msg) Start a fast import commit |

deleteall(self) Issue deleteall to fastimport so we start from a empty tree |

close(self) Close fast-import issuing all pending actions |

__del__(self) |

Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Class Variables | [hide private]

| _bufsize = `1024`
| m_regular = `644`
| m_exec = `755`
| m_symlink = `120000`

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, repo)
(Constructor)

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  - `repo` (GitRepository) - the git repository FastImport acts on
Overrides: object.__init__

### add_file(self, filename, fd, size, mode=644)

Add a file

Parameters:
  - `filename` (`str`) - the name of the file to add
  - `fd` (`File` like object) - stream to read data from
  - `size` (`int`) - size of the file to add
  - `mode` (`int`) - file mode, default is FastImport.m_regular.

### add_symlink(self, linkname, linktarget)

Add a symlink

Parameters:
  - `linkname` - the symbolic link's name
  - `linkname` - `str`
  - `linktarget` (`str`) - the target the symlink points to

### start_commit(self, branch, committer, msg)

Start a fast import commit

Parameters:
  - `branch` (`str`) - branch to commit on
  - `committer` (GitModifier) - the committer information
  - `msg` (`str`) - the commit message