Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何仅在重新基址后运行mercurial changegroup挂钩?_Mercurial_Mercurial Hook - Fatal编程技术网

如何仅在重新基址后运行mercurial changegroup挂钩?

如何仅在重新基址后运行mercurial changegroup挂钩?,mercurial,mercurial-hook,Mercurial,Mercurial Hook,我们有一个简单的mercurial钩子,每次我们拉远程更改时都会运行它。我们使用变更组钩子。我们的钩子重建了一些DLL并将它们复制到一个文件夹中。当我们拉动时,我们会自动重新设定基准。这导致我们的钩子运行两次,第一次是在拉的时候,然后是在自动重新定位之后 有没有简单的方法来检测是否会有一个重基,并且只在重基结束时运行一次挂钩 谢谢,你能展示一下你原来的钩子吗 无论如何,如果您检查源参数,您可以选择钩子是否应该运行: def changegroup_hook(ui, repo, source, *

我们有一个简单的mercurial钩子,每次我们拉远程更改时都会运行它。我们使用变更组钩子。我们的钩子重建了一些DLL并将它们复制到一个文件夹中。当我们拉动时,我们会自动重新设定基准。这导致我们的钩子运行两次,第一次是在拉的时候,然后是在自动重新定位之后

有没有简单的方法来检测是否会有一个重基,并且只在重基结束时运行一次挂钩


谢谢,

你能展示一下你原来的钩子吗

无论如何,如果您检查源参数,您可以选择钩子是否应该运行:

def changegroup_hook(ui, repo, source, **kwargs):
    if source != 'strip':  # rebase operation uses 'strip' as source
       return 0  # SUCCESS
    # continue rebase processing

你能展示一下你原来的钩子吗

无论如何,如果您检查源参数,您可以选择钩子是否应该运行:

def changegroup_hook(ui, repo, source, **kwargs):
    if source != 'strip':  # rebase operation uses 'strip' as source
       return 0  # SUCCESS
    # continue rebase processing