mirror of
https://github.com/newren/git-filter-repo.git
synced 2024-11-07 09:20:29 +00:00
35052f673d
This is by far the largest python3 change; it consists basically of * using b'<str>' instead of '<str>' in lots of places * adding a .encode() if we really do work with a string but need to get it converted to a bytestring * replace uses of .format() with interpolation via the '%' operator, since bytestrings don't have a .format() method. Signed-off-by: Elijah Newren <newren@gmail.com>
24 lines
684 B
Python
Executable File
24 lines
684 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
"""
|
|
Please see the
|
|
***** API BACKWARD COMPATIBILITY CAVEAT *****
|
|
near the top of git-filter-repo.
|
|
|
|
Also, note that splicing repos may need some special care as fast-export
|
|
only shows the files that changed relative to the first parent, so there
|
|
may be gotchas if you are to splice near merge commits; this example does
|
|
not try to handle any such special cases.
|
|
"""
|
|
|
|
import git_filter_repo as fr
|
|
|
|
def my_commit_callback(commit):
|
|
if commit.branch == b"refs/heads/master":
|
|
commit.branch = b"refs/heads/develop"
|
|
|
|
args = fr.FilteringOptions.default_options()
|
|
args.force = True
|
|
filter = fr.RepoFilter(args, commit_callback = my_commit_callback)
|
|
filter.run()
|