Re: [PATCH v3 05/10] remote-hg: fix new branch creation
Felipe Contreras felipe.contre...@gmail.com writes: Felipe Contreras wrote: When force_push is disabled, we need to turn the argument to True. With your follow-up clarification, here is what ended up in the log message: remote-hg: fix new branch creation When a user creates a new branch with git: $ git checkout -b branches/devel and then pushes this branch $ git push origin branches/devel which is the way to push new mercurial branches, we do want to create a branch, but the command would fail without newbranch=True. This only matters when force_push=False, but setting newbranch=True unconditionally does not hurt. The only part that I came up with on my own is but ... does not hurt at the end. If that is incorrect, please supply an update. Thanks. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- contrib/remote-helpers/git-remote-hg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg index 4a5c72f..3cf9b4c 100755 --- a/contrib/remote-helpers/git-remote-hg +++ b/contrib/remote-helpers/git-remote-hg @@ -856,7 +856,7 @@ def do_export(parser): continue if peer: -parser.repo.push(peer, force=force_push) +parser.repo.push(peer, force=force_push, newbranch=True) # handle bookmarks for bmark, node in p_bmarks: -- 1.8.3.rc1.579.g184e698 -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 05/10] remote-hg: fix new branch creation
On Wed, May 15, 2013 at 2:40 PM, Junio C Hamano gits...@pobox.com wrote: Felipe Contreras felipe.contre...@gmail.com writes: Felipe Contreras wrote: When force_push is disabled, we need to turn the argument to True. With your follow-up clarification, here is what ended up in the log message: remote-hg: fix new branch creation When a user creates a new branch with git: $ git checkout -b branches/devel and then pushes this branch $ git push origin branches/devel which is the way to push new mercurial branches, I don't like this part. This is not documentation, this is a commit message. You don't explain how git works in every commit message. It's not relevant how to create Mercurial branches, it could be done through a totally different way and it wouldn't affect this patch. The only thing that is relevant is that a new Mercurial branch is created somehow. But since you never, *ever*, agree that a piece of information in the commit message is not useful, I realize this is wasted breath. we do want to create a branch, but the command would fail without newbranch=True. This only matters when force_push=False, but setting newbranch=True unconditionally does not hurt. The only part that I came up with on my own is but ... does not hurt at the end. If that is incorrect, please supply an update. It's correct. -- Felipe Contreras -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH v3 05/10] remote-hg: fix new branch creation
This is the first fix, but it's obvious this is what we want: if a user creates a new branch with git: % git checkout -b branches/devel And then pushes this branch % git push origin branches/devel (which is the way to push new mercurial branches) We obviously want to create a branch, but the command would fail, and the fix is simple: tell the push that we might create new branches. This only matters when foce_push=False. Can't possibly introduce regressions, unless you think of the ability to push new branches as a regression. Felipe Contreras wrote: When force_push is disabled, we need to turn the argument to True. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- contrib/remote-helpers/git-remote-hg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg index 4a5c72f..3cf9b4c 100755 --- a/contrib/remote-helpers/git-remote-hg +++ b/contrib/remote-helpers/git-remote-hg @@ -856,7 +856,7 @@ def do_export(parser): continue if peer: -parser.repo.push(peer, force=force_push) +parser.repo.push(peer, force=force_push, newbranch=True) # handle bookmarks for bmark, node in p_bmarks: -- 1.8.3.rc1.579.g184e698 -- Felipe Contreras -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 05/10] remote-hg: fix new branch creation
When force_push is disabled, we need to turn the argument to True. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- contrib/remote-helpers/git-remote-hg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg index 4a5c72f..3cf9b4c 100755 --- a/contrib/remote-helpers/git-remote-hg +++ b/contrib/remote-helpers/git-remote-hg @@ -856,7 +856,7 @@ def do_export(parser): continue if peer: -parser.repo.push(peer, force=force_push) +parser.repo.push(peer, force=force_push, newbranch=True) # handle bookmarks for bmark, node in p_bmarks: -- 1.8.3.rc1.579.g184e698 -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html