Re: [PATCH v2 13/13] remote-hg: push to the appropriate branch

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH v2 13/13] remote-hg: push to the appropriate branch

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:56:41

Felipe Contreras [off-list ref] writes:
quoted hunk
From: Dusty Phillips <redacted>

Signed-off-by: Felipe Contreras <redacted>
---
 contrib/remote-helpers/git-remote-hg | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg
index 56b3641..d82eb2d 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -625,6 +625,10 @@ def parse_commit(parser):
     if merge_mark:
         get_merge_files(repo, p1, p2, files)
 
+    # Check if the ref is supposed to be a named branch
+    if ref.startswith('refs/heads/branches/'):
+        extra['branch'] = ref.rpartition('/')[2]
+
Is this meant to cut everything after "refs/heads/branches/", or cut
at the last slash?  I know rpartition does the latter, but I was
wondering if we see "refs/heads/branches/foo/bar" as its input here.
     if mode == 'hg':
         i = data.find('\n--HG--\n')
         if i >= 0:

Re: [PATCH v2 13/13] remote-hg: push to the appropriate branch

From: Felipe Contreras <hidden>
Date: 2016-06-15 22:56:42

On Thu, Apr 4, 2013 at 10:50 AM, Junio C Hamano [off-list ref] wrote:
Felipe Contreras [off-list ref] writes:
quoted
From: Dusty Phillips <redacted>

Signed-off-by: Felipe Contreras <redacted>
---
 contrib/remote-helpers/git-remote-hg | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg
index 56b3641..d82eb2d 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -625,6 +625,10 @@ def parse_commit(parser):
     if merge_mark:
         get_merge_files(repo, p1, p2, files)

+    # Check if the ref is supposed to be a named branch
+    if ref.startswith('refs/heads/branches/'):
+        extra['branch'] = ref.rpartition('/')[2]
+
Is this meant to cut everything after "refs/heads/branches/", or cut
at the last slash?  I know rpartition does the latter, but I was
wondering if we see "refs/heads/branches/foo/bar" as its input here.
Good catch, it should be the former.

-- 
Felipe Contreras
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help