Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
git
提交
01ce1fe9
G
git
项目概览
李少辉-开发者
/
git
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
git
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
01ce1fe9
编写于
4月 07, 2007
作者:
S
Simon Hausmann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added git-p4 rebase convenience
Signed-off-by:
N
Simon Hausmann
<
simon@lst.de
>
上级
711544b0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
3 deletion
+33
-3
contrib/fast-import/git-p4
contrib/fast-import/git-p4
+20
-2
contrib/fast-import/git-p4.txt
contrib/fast-import/git-p4.txt
+13
-1
未找到文件。
contrib/fast-import/git-p4
浏览文件 @
01ce1fe9
...
...
@@ -804,7 +804,11 @@ class P4Sync(Command):
def
getLabels
(
self
):
self
.
labels
=
{}
for
output
in
p4CmdList
(
"labels %s..."
%
self
.
globalPrefix
):
l
=
p4CmdList
(
"labels %s..."
%
self
.
globalPrefix
)
if
len
(
l
)
>
0
:
print
"Finding files belonging to labels in %s"
%
self
.
globalPrefix
for
output
in
l
:
label
=
output
[
"label"
]
revisions
=
{}
newestChange
=
0
...
...
@@ -1039,6 +1043,19 @@ class P4Sync(Command):
return
True
class
P4Rebase
(
Command
):
def
__init__
(
self
):
Command
.
__init__
(
self
)
self
.
options
=
[
]
self
.
description
=
"Fetches the latest revision from perforce and rebases the current work (branch) against it"
def
run
(
self
,
args
):
sync
=
P4Sync
()
sync
.
run
([])
print
"Rebasing the current branch"
system
(
"git rebase p4"
)
return
True
class
HelpFormatter
(
optparse
.
IndentedHelpFormatter
):
def
__init__
(
self
):
optparse
.
IndentedHelpFormatter
.
__init__
(
self
)
...
...
@@ -1061,7 +1078,8 @@ commands = {
"debug"
:
P4Debug
(),
"clean-tags"
:
P4CleanTags
(),
"submit"
:
P4Submit
(),
"sync"
:
P4Sync
()
"sync"
:
P4Sync
(),
"rebase"
:
P4Rebase
()
}
if
len
(
sys
.
argv
[
1
:])
==
0
:
...
...
contrib/fast-import/git-p4.txt
浏览文件 @
01ce1fe9
...
...
@@ -40,12 +40,24 @@ newer changes from the Perforce depot by just calling
git-p4 sync
in your git repository.
in your git repository.
By default the "p4" branch is updated.
It is recommended to run 'git repack -a -d -f' from time to time when using
incremental imports to optimally combine the individual git packs that each
incremental import creates through the use of git-fast-import.
Updating
========
A common working pattern is to fetch the latest changes from the Perforce depot
and merge them with local uncommitted changes. The recommended way is to use
git's rebase mechanism to preserve linear history. git-p4 provides a convenient
git-p4 rebase
command that calls git-p4 sync followed by git rebase to rebase the current
working branch.
Submitting
==========
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录