Python 的 Git 開發包,Pygit2 0.22.1 發布

cebp 9年前發布 | 10K 次閱讀 Pygit2

Pygit2是libgit2共享庫的一組Python綁定,libgit2是Git核心的實現。 Pygit2支持Python 2.7, 3.2, 3.3, 3.4 和 pypy。

Pygit2 0.22.1 發布,Pygit2 是 Python 的 Git 開發包,更新內容如下:

不同接口重構#346(in progress):

  • 新 iter(pygit2.Blame)

    </li>

  • pygit2.DiffDelta, pygit2.DiffFilepygit.DiffLine

    </li>

  • API 改進和翻譯提供:

    Hunk                => DiffHunk
    Patch.old_file_path => Patch.delta.old_file.path
    Patch.new_file_path => Patch.delta.new_file.path
    Patch.old_id        => Patch.delta.old_file.id
    Patch.new_id        => Patch.delta.new_file.id
    Patch.status        => Patch.delta.status
    Patch.similarity    => Patch.delta.similarity
    Patch.is_binary     => Patch.delta.is_binary
    Patch.additions     => Patch.line_stats[1]
    Patch.deletions     => Patch.line_stats[2]
    </li>

  • DiffHunk.lines 是列表 DiffLine 的對象,而不是元組

    </li> </ul>

    新特性

    • New Repository.expand_id(...) and Repository.ahead_behind(...)#448

      </li>

    • New prefix parameter in Repository.write_archive#481

      </li>

    • New Repository.merge_trees(...)#489

      </li>

    • New Repository.cherrypick(...)#436#492

      </li>

    • New support for submodules#499#514

      </li>

    • New Repository.merge_file_from_index(...)#503

      </li>

    • Now Repository.diff supports diffing two blobs#508

      </li>

    • New optional fetch parameter in Remote.create#526

      </li>

    • New pygit2.DiffStats#406#525

      </li>

    • New Repository.get_attr(...)#528

      </li>

    • New level optional parameter in Index.remove#533

      </li>

    • New repr(TreeEntry)#543

      </li> </ul>

      構建和安裝改進:

      • Make pygit work in a frozen environment#453

        </li>

      • Make pygit2 work with pyinstaller#510

        </li> </ul>

        Bugs 修復:

        • Fix memory issues#477#487#520

          </li>

        • Fix TreeEntry equality testing#458#488

          </li>

        • Repository.write_archive fix handling of symlinks#480

          </li>

        • Fix type check in Diff[...]#495

          </li>

        • Fix error when merging files with unicode content#505

          </li> </ul>

          其他: