问题标签 [hgrc]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
76 浏览

mercurial - 从扩展编辑 repo 配置文件

hgrc是否有使用 Mercurial API编辑存储库配置文件的内置机制?我正在编写一个扩展,需要在配置文件中存储一些选项,我想为此提供一个命令(需要存储的选项涉及时间戳,用户手动编辑会有点棘手) .

0 投票
1 回答
99 浏览

version-control - 是否可以将部分 mercurial hgrc 文件签入到 repo 中?具体来说, [path] 部分

在对 google 和 stack 进行了一些研究之后,似乎不可能将 hgrc 文件签入 repo,出于各种安全原因,这很有意义。

但是,我有一个有趣的设置,我想知道是否有人知道让这更容易的方法。

具体来说,我们经营着大量的电子商务商店,其中的模板是基于基础仓库构建的,并且每个商店也有自己的仓库(继承自基础仓库)。

我们也有许多开发环境,因此为了使这更容易,我们在 hgrc 中大量使用 [path] 指令。

这是我们的设置示例:

假设我们有以下商店的模板存储库:electronic_store、clothing_store、toy_store,以及一个名为 base 的基本模板

我们还有以下环境:paris、london 和 live

因此,在每个商店的 hgrc 中,我们有以下内容:

这使得在任何环境中都可以轻松进行 hg pull base、hg push/pull paris、hg push/pull live 等

但是,我们经常关闭环境并打开新环境,然后不仅在每个店面(我们希望这样做)而且在每个环境中更新所有存储库的 hgrc 都会变得非常乏味。由于没有跟踪 hgrc,因此无法像我们预期的那样通过简单的拉/推来同步这些更改。

我们也不能将这些添加到我们的全局 .hgrc 文件中,因为虽然路径名称相同,但它们会推送/拉到各自的存储库(即,电子商店上的 hg push paris 与服装商店上的 hg push paris 是不同的存储库)

有什么方法可以使 hgrc 的 [path] 部分在 repo 中可跟踪?或者,如果失败了,根据我们目前的设置,是否有任何其他建议可以更轻松地管理我所描述的存储库?

提前致谢。

0 投票
1 回答
152 浏览

mercurial - 让 Mercurial 告诉你它加载的 hgrc 文件

我经常找不到 Mercurial 加载的 hgrc 文件。

我知道可能的位置记录在http://linux.die.net/man/5/hgrc,但是其中有很多,它们因平台而异,它们取决于诸如“Mercurial”之类的东西安装目录”,这是另一件必须追踪的事情。有时,它似乎正在从根本不在该列表中的位置加载 hgrc 文件!

如果我能让 Mercurial告诉我它正在加载哪些 hgrc 文件,那就太好了,这样我就不必花时间搜索它们了。基本上,我希望能够传递hg一个选项,比如hg -debug-hgrc-paths让它打印hgrc它加载的每个文件的完整路径。就像您如何gcc打印与gcc -v -E. 有谁知道这样的选择?

0 投票
1 回答
346 浏览

php - Mercurial 在更新后更改文件的所有者

我有一个由 mercurial 控制的 php webapp。它在 /var/www/directory/ 中。这些文件归用户和组“www-data”所有。在我进行一些更改后,这些文件将归 root.root 所有。

那是因为 hg 是由 root 运行的?这是一个远程服务器,我只有root访问权限,如何解决这个问题?我不想在每次拉取后手动和递归地在目录中运行 chown ,也因为有些子目录不属于 www-data 。

不知道我做的对不对,尝试修改hgrc

没用

0 投票
1 回答
473 浏览

mercurial - Mercurial bitbucket 授权失败

我根据 1Pass 的瞭望塔推荐更改了我的 Bitbucket 密码。从那以后,尽管我可以通过浏览器登录,但我无法拉/推我的任何存储库。我已经尝试过 HTTP 和 SSH,但都不起作用。

这是一个示例输出。

我很好奇为什么当我~/.hgrc看起来像这样时它说“密码未设置”:

我的直觉是密码字段中不允许使用某些字符?这是通过 1Pass 随机生成的。是这样吗?

以防万一, repo.hg/hgrc中的内容cs1如下所示:

[paths] default = https://caliChander@bitbucket.org/caliChander/cs1

我在 OS X Mavericks 上。谢谢您的帮助!

0 投票
1 回答
610 浏览

mercurial - 找不到 hgrc 文件

我正在尝试为 mercurial 设置我的用户名和密码。先前问题的答案说在 .hgrc 文件中添加以下行

但是我找不到这个文件,我只在我的主目录中看到 .hg 文件。

0 投票
1 回答
474 浏览

mercurial - 仅当存在 .hgrc 时才启用 mercurial 扩展

我的.hgrc文件中有很多东西,所以我将它保存在存储库中并在计算机之间共享。

我在该[extensions]部分启用了很多扩展,但我不一定想在我的所有计算机上都使用它们。

不幸的是,每当我尝试在.hgrc没有安装每个指定扩展的计算机上使用 Mercurial 和我的共享文件时,我都会收到以下形式的消息:

每次我运行任何hg命令!

有没有办法避免这种情况?例如,有没有办法在.hgrc文件中指定“如果可以找到则加载此扩展名,否则不加载它并保持安静”?(然后,如果我真的尝试使用扩展,我会得到一个错误。)


其他搜索词:

  • 如何有条件地启用 Mercurial 扩展
  • 根据条件激活 Mercurial 扩展
  • 仅当 Mercurial 扩展存在时才启用它
0 投票
1 回答
596 浏览

file-io - File History for Renamed Files in TortoiseHg

I know how to use Mercurial to rename a file. And I understand that the hg log command does not display file history prior to renaming the file unless you use the -f option, and also that you can force the file history to be displayed as described in the accepted answer here Why 'hg mv' (mercurial) doesn't move a file's history by default?

However, when I rename a file, and then check the File History using TortoiseHg, I am unable to view the full history of the file including any changes prior to renaming the file, even though I updated my ~/.hgrc file to include those changes as explanined in the aforementioned link. How can I do that? How can I force File History to include changes that happened to the file prior to renaming the file, and display that history list on TortoisHg?


UPDATE

TertoiseHg version 3.1 shows the full history. I had version 2.8 that did now show the history.

Thanks to Lazy Badger for his answer.

0 投票
1 回答
271 浏览

mercurial - 不能为 hg 的大文件扩展使用过滤器模式

我的 hgrc 配置文件如下:

[扩展] 大文件 =

[大文件] 模式 = *.jpg *.png *.bmp *.gif *.mp3 *.a *.jar *.psd *.ai *.unity *.ttf *.zip *.rar

我通过创建文件进行测试a.jpg,hg add --large a.jpg,文件已.hglf正确创建。我创建了b.jpg,hg add b.jpg,文件也已.hglf正确创建。

如果我不先 hg add --large a.jpg ,这将由于某种原因而失败。

接下来,我创建了子目录,在其中创建了 c.jpg 文件,hg add c.jpg,在 .hglf 中没有创建任何内容。这使得过滤器模式在子目录中后不再起作用。我应该怎么做才能为 repo 中的所有文件“hg add *”并正确过滤哪个是文本文件,哪个是二进制文件作为 .hgrc 配置文件中的配置。

0 投票
1 回答
128 浏览

mercurial - 禁用特定回购源的 Mercurial Hooks

在我的计算机上,我有一些Mercurial提交钩子,它们在每次提交时运行,以确保我正确地分支并做一些其他事情。但我只需要这些用于工作项目。

以下是在我的 ~/.hgrc 文件中实现的钩子:

对于我的个人项目,我不想使用同样烦人的钩子(设置为全局)。我希望我从 bitbucket 签出的所有存储库都不要使用这些钩子。我该如何设置它来做到这一点?