Ggit.Diff¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
Repository |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Ggit.Diff(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Represents a diff list.
- classmethod blob_to_buffer(old_blob, old_as_path, buffer, buffer_as_path, diff_options, file_cb, binary_cb, hunk_cb, line_cb, *user_data)¶
- Parameters:
old_as_path (
str
orNone
) – treat old_blob as if it had this filename, orNone
,buffer_as_path (
str
orNone
) – treat buffer as if it had this filename, orNone
,diff_options (
Ggit.DiffOptions
orNone
) – aGgit.DiffOptions
, orNone
.file_cb (
Ggit.DiffFileCallback
orNone
) – aGgit.DiffFileCallback
.binary_cb (
Ggit.DiffBinaryCallback
orNone
) – aGgit.DiffBinaryCallback
.hunk_cb (
Ggit.DiffHunkCallback
orNone
) – aGgit.DiffHunkCallback
.line_cb (
Ggit.DiffLineCallback
orNone
) – aGgit.DiffLineCallback
.
- Raises:
Same as
Ggit.Diff.blobs
() but using a buffer.
- classmethod blobs(old_blob, old_as_path, new_blob, new_as_path, diff_options, file_cb, binary_cb, hunk_cb, line_cb, *user_data)¶
- Parameters:
old_as_path (
str
orNone
) – treat old_blob as if it had this filename, orNone
,new_as_path (
str
orNone
) – treat new_blob as if it had this filename, orNone
,diff_options (
Ggit.DiffOptions
orNone
) – aGgit.DiffOptions
, orNone
.file_cb (
Ggit.DiffFileCallback
orNone
) – aGgit.DiffFileCallback
.binary_cb (
Ggit.DiffBinaryCallback
orNone
) – aGgit.DiffBinaryCallback
.hunk_cb (
Ggit.DiffHunkCallback
orNone
) – aGgit.DiffHunkCallback
.line_cb (
Ggit.DiffLineCallback
orNone
) – aGgit.DiffLineCallback
.
- Raises:
Iterates over the diff calling file_cb, binary_cb, hunk_cb and line_cb.
The
Ggit.DiffFile
mode always be 0, path will beNone
and when a blob isNone
the oid will be 0.If diff_options is
None
then the defaults specified inGgit.DiffOptions.new
() are used.
- classmethod new_buffers(buffer1, buffer1_as_path, buffer2, buffer2_as_path, diff_options)¶
- Parameters:
buffer1_as_path (
str
orNone
) – treat buffer1 as if it had this filename, orNone
,buffer2_as_path (
str
orNone
) – treat buffer2 as if it had this filename, orNone
,diff_options (
Ggit.DiffOptions
orNone
) – aGgit.DiffOptions
, orNone
.
- Raises:
- Returns:
a newly allocated
Ggit.Diff
if there was no error,None
otherwise.- Return type:
Same as
Ggit.Diff.blobs
() but using a buffers. Creates aGgit.Diff
which compares buffer1 and buffer2.If diff_options is
None
then the defaults specified inGgit.DiffOptions.new
() are used.
- classmethod new_index_to_workdir(repository, index, diff_options)¶
- Parameters:
repository (
Ggit.Repository
) – aGgit.Repository
.index (
Ggit.Index
orNone
) – aGgit.Index
, orNone
.diff_options (
Ggit.DiffOptions
orNone
) – aGgit.DiffOptions
, orNone
.
- Raises:
- Returns:
a newly allocated
Ggit.Diff
if there was no error,None
otherwise.- Return type:
Creates a
Ggit.Diff
which compares the working directory and the index.If index is
None
then repository index is used. If diff_options isNone
then the defaults specified inGgit.DiffOptions.new
() are used.
- classmethod new_tree_to_index(repository, old_tree, index, diff_options)¶
- Parameters:
repository (
Ggit.Repository
) – aGgit.Repository
.index (
Ggit.Index
orNone
) – aGgit.Index
, orNone
.diff_options (
Ggit.DiffOptions
orNone
) – aGgit.DiffOptions
, orNone
.
- Raises:
- Returns:
a newly allocated
Ggit.Diff
if there was no error,None
otherwise.- Return type:
Creates a
Ggit.Diff
which compares old_tree and the index.If index is
None
then repository index is used. If diff_options isNone
then the defaults specified inGgit.DiffOptions.new
() are used.
- classmethod new_tree_to_tree(repository, old_tree, new_tree, diff_options)¶
- Parameters:
repository (
Ggit.Repository
) – aGgit.Repository
.diff_options (
Ggit.DiffOptions
orNone
) – aGgit.DiffOptions
, orNone
.
- Raises:
- Returns:
a newly allocated
Ggit.Diff
if there was no error,None
otherwise.- Return type:
Creates a
Ggit.Diff
which compares old_tree and new_tree.If diff_options is
None
then the defaults specified inGgit.DiffOptions.new
() are used.
- classmethod new_tree_to_workdir(repository, old_tree, diff_options)¶
- Parameters:
repository (
Ggit.Repository
) – aGgit.Repository
.diff_options (
Ggit.DiffOptions
orNone
) – aGgit.DiffOptions
, orNone
.
- Raises:
- Returns:
a newly allocated
Ggit.Diff
if there was no error,None
otherwise.- Return type:
Creates a
Ggit.Diff
which compares the working directory and old_tree.If diff_options is
None
then the defaults specified inGgit.DiffOptions.new
() are used.
- find_similar(options)¶
- Parameters:
options (
Ggit.DiffFindOptions
orNone
) – aGgit.DiffFindOptions
orNone
.- Raises:
- Returns:
- Return type:
Transform self marking file renames, copies, etc.. If options is set to
None
, then the default options will be used.
- foreach(file_cb, binary_cb, hunk_cb, line_cb, *user_data)¶
- Parameters:
file_cb (
Ggit.DiffFileCallback
orNone
) – aGgit.DiffFileCallback
.binary_cb (
Ggit.DiffBinaryCallback
orNone
) – aGgit.DiffBinaryCallback
.hunk_cb (
Ggit.DiffHunkCallback
orNone
) – aGgit.DiffHunkCallback
.line_cb (
Ggit.DiffLineCallback
orNone
) – aGgit.DiffLineCallback
.
- Raises:
Iterates over the diff calling file_cb, binary_cb, hunk_cb and line_cb.
- format_email(options)¶
- Parameters:
options (
Ggit.DiffFormatEmailOptions
) – aGgit.DiffFormatEmailOptions
.- Raises:
- Returns:
the patch or
None
if an error occurred.- Return type:
Create an e-mail ready patch from a diff.
- get_delta(index)¶
- Parameters:
index (
int
) – the index.- Returns:
a
Ggit.DiffDelta
orNone
.- Return type:
Get the delta at the specified index.
- get_num_deltas()¶
- Returns:
the number of deltas.
- Return type:
Get the number of deltas in the diff.
- merge(from_)¶
- Parameters:
- Raises:
Merges from into self unless error is set.
- print_(type, print_cb, *user_data)¶
- Parameters:
type (
Ggit.DiffFormatType
) – aGgit.DiffFormatType
.print_cb (
Ggit.DiffLineCallback
) – aGgit.DiffLineCallback
.
- Raises:
Iterates over self generating text output like “git diff”.
Property Details¶
- Ggit.Diff.props.repository¶
- Name:
repository
- Type:
- Default Value:
- Flags:
Repository