简体   繁体   English

如何在Bitbucket上创建Mercurial书签的拉取请求?

[英]How to create pull request from Mercurial bookmark on Bitbucket?

可以将Mercurial书签推送到Bitbucket,但是有人知道如何从它们创建拉取请求吗?

Based on information from this thread (thanks sirex for sum up). 基于此线程的信息(感谢sirex总结)。 It is not user friendly, but possible. 它不是用户友好的,但可能。

书签哈希

  • push Pull request button and make sure the hash in drop down matches push Pull request按钮并确保下拉列表中的哈希匹配
  • that's it 而已

I'm using bookmarks for pull requests quite actively with my team, for a few weeks. 几周后,我正在与我的团队积极地使用书签来提取请求。 Here how it works for me: 这里它对我有用:

  1. Create bookmark, called master on default branch: 创建书签,在default分支上称为master

     hg bo master -r default 

    If you don't do this, then after creating two branches on default , when one is named with bookmark, then other will be left as anonymous branch. 如果不这样做,那么在default创建两个分支后,当一个分支以书签命名时,其他分支将保留为匿名分支。 So master bookmark is needed to name this anonymous branch. 因此,需要master书签来命名此匿名分支。

  2. Make this master branch public in your fork repository and in upstream repository: 在fork存储库和上游存储库中公开此master分支:

     hg push -B master hg push upstream -B master 

    You can manage repository aliases in .hg/hgrc file (relative to your repository), example: 您可以在.hg/hgrc文件(相对于您的存储库)中管理存储库别名,例如:

     [paths] default = ssh://hg@bitbucket.org/foo/upstream upstream = ssh://hg@bitbucket.org/upstream/upstream 
  3. Ask your team to pull master bookmark: 请你的团队拉出master书签:

     hg pull -B master 
  4. Start to work on a feature, using bookmark: 使用书签开始处理功能:

     hg bo feature-1 hg ci -m "Some changes." hg push 
  5. In Bitbucket, press "Pull request" button, or type "x" then "p". 在Bitbucket中,按“拉请求”按钮,或键入“x”,然后键入“p”。

  6. On left side, select you branch, to create pull request from it. 在左侧,选择分支,从中创建拉取请求。 If your default has only one branch (to check that, see hg heads default ), then your bookmark branch will be displayed as default , but if you have more than one branch on default , then you will see some think like this default (0932c9ab2029) , you can find correct one by matching hash value from hg bo . 如果您的default只有一个分支(检查,见hg heads default ),那么你的书签的分支将显示为default ,但如果你有一个以上的分支default ,然后你会看到有些人认为这样的default (0932c9ab2029) ,您可以通过匹配hg bo哈希值找到正确的一个。 After selecting branch, pull request title will be filled with last commit from selected branch. 选择分支后,将从所选分支的最后一次提交填充拉请求标题。

  7. Press "Create pull request" button at the bottom, and that's it, your pull request will be created. 按下底部的“创建拉取请求”按钮,就是这样,您的拉取请求将被创建。

  8. To create new pull request, first pull changes from upstream repository: 要创建新的pull请求,首先从上游存储库中提取更改:

     hg pull upstream 
  9. Update to master : 更新master

     hg up master 
  10. And start your new feature branch using bookmark: 并使用书签启动新功能分支:

     hg bo feature-2 

If you don't have possibility, to ask your team, to use master bookmark as a bookmark to original default , then I would suggest you to create you personal named branch for example named as your nickname, and work with bookmarks using your personal named branch instead of working on default . 如果您没有可能要求您的团队使用master书签作为原始default书签,那么我建议您创建个人命名分支,例如命名为您的昵称,并使用您的个人名称处理书签分支而不是default工作。 In this case work flow will be this: 在这种情况下,工作流程将是这样的:

  1. Create your personal named branch: 创建您的个人命名分支:

     hg branch nickname hg ci -m "Starting my personal branch for feature branch management." 
  2. Create local master bookmark: 创建本地master书签:

     hg bo master 
  3. Start to work on a feature, using bookmark: 使用书签开始处理功能:

     hg bo feature-1 hg ci -m "Some changes." hg push 
  4. In Bitbucket, press "Pull request" button, or type "x" then "p". 在Bitbucket中,按“拉请求”按钮,或键入“x”,然后键入“p”。

  5. On left side, select you branch, to create pull request from it. 在左侧,选择分支,从中创建拉取请求。 If your nickname named branch has only one head (to check that, see hg heads nickname ), then your bookmark branch will be displayed as nickname , but if you have more than one branch on nickname , then you will see some think like this nickname (0932c9ab2029) , you can find correct one by matching hash value from hg bo . 如果你的nickname命名分支只有一个头(要检查,请参阅hg heads nickname ),那么你的书签分支将显示为nickname ,但如果你在nickname上有多个分支,那么你会看到一些像这个nickname (0932c9ab2029)想法nickname (0932c9ab2029) ,您可以通过匹配hg bo哈希值找到正确的一个。 After selecting branch, pull request title will be filled with last commit from selected branch. 选择分支后,将从所选分支的最后一次提交填充拉请求标题。

  6. Press "Create pull request" button at the bottom, and that's it, your pull request will be created. 按下底部的“创建拉取请求”按钮,就是这样,您的拉取请求将被创建。

  7. To create new pull request, first pull changes from upstream repository: 要创建新的pull请求,首先从上游存储库中提取更改:

     hg pull upstream 
  8. Update to master : 更新master

     hg up master 
  9. Merge default to master 合并defaultmaster

     hg merge default hg ci -m merge 
  10. And start your new feature branch using bookmark: 并使用书签启动新功能分支:

     hg bo feature-2 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM