我正在尝试修改此Mercurial扩展,以提示用户在其提交消息中添加FogBugz案例编号.理想情况下,我希望用户在提示后只输入一个数字,并将其自动附加到提交消息中.
这是我到目前为止所得到的:
def pretxncommit(ui, repo, **kwargs):
tip = repo.changectx(repo.changelog.tip())
if not RE_CASE.search(tip.description()) and len(tip.parents()) < 2:
casenumResponse = ui.prompt('*** Please specify a case number, x to abort, or hit enter to ignore:', '')
casenum = RE_CASENUM.search(casenumResponse)
if casenum:
# this doesn't work!
# tip.description(tip.description() + ' (Case ' + casenum.group(0) + ')')
return True
elif (casenumResponse == 'x'):
ui.warn('*** User aborted\n')
return True
return True
return False
Run Code Online (Sandbox Code Playgroud)
我无法找到的是一种编辑提交消息的方法.tip.description似乎是只读的,我没有在文档或示例中看到任何可以让我修改它的内容.我看到编辑提交消息的唯一引用与补丁和Mq扩展有关,看起来似乎没有帮助.
关于如何设置提交消息的任何想法?
我和远程回购的人合作.我们意识到我所做的更改应该从回购中删除.但是,这些变化存在于许多变化中,并与某人的变化相混合.
在我提交另一个变更集之前,我们决定删除我的更改.所以我用一些未经修改的变化做了补丁qpop.
现在我想从遥控器中退出我的其余更改,并选择性地修改这些更改,让我的同事改变不变.
此外,我希望在一个补丁中使用来自patch_ive_made_before的差异的新补丁中的差异.换句话说 - 我想从2个不同的变更集中选择一个补丁.我必须手动完成吗?
然后,在我这样做之后,我将commit/ push清除更改到存储库中.
Mercurial Queues如何做到这一点?
我在本地存储库中有两个分支:default和s1。
在default分支处,有一个名为的文件def.txt。该s1分公司有命名为文件set3.txt,set1.txt等我想补充set1.txt的s1分支default的分支也。
hg add set1.txt当工作目录位于default分支时,我尝试使用命令。但是,由于defaultbranch没有文件,因此无法添加它,并且始终会显示错误消息,例如"no set1.txt file found"。
我不想使用merge命令,因为我不想合并所有其他文件从一个s1分支到另一个default分支。我只想添加一个文件set1.txt。我也尝试hg transplant -b s1过,但似乎没有达到相同的目的。
那么有什么想法可以解决这个问题吗?我的目标是使这两个分支如下所示:
default:def.txt,set1.txt等等。
s1:set1.txt,set3.txt等等。
我的机器是Red Hat Linux Workstation 6,它具有Mercurial 1.7.3和TortoiseHG 1.5。
在2015年的F8会议视频(从8:40开始)中,他们谈到了使用Mercurial和Facebook上的单个存储库的优势.
这在实践中如何运作?使用Mercurial,我可以签出一个子目录(住在SVN)吗?如果是这样,怎么样?我需要一个Facebook的善变扩展此
我添加了条带扩展 hgrc 配置。(苹果系统)
cd ~
nano .hgrc
Run Code Online (Sandbox Code Playgroud)
在[extension]添加的行下:
strip =
Run Code Online (Sandbox Code Playgroud)
即使 vagrant restart 或 mac restart 也没有帮助,命令仍然无法识别。
hgrc 文件:
[ui]
# name and email, e.g.
# username = Jane Doe <jdoe@example.com>
username = ....>
ignore=~/.hgignore_global
# We recommend enabling tweakdefaults to get slight improvements to
# the UI over time. Make sure to set HGPLAIN in the environment when
# writing scripts!
# tweakdefaults = True
# uncomment to disable color in command output
# (see 'hg help …Run Code Online (Sandbox Code Playgroud)