Re: [PATCH v3 08/20] remote-hg: split bookmark handling

2013-04-10 Thread Junio C Hamano
Felipe Contreras  writes:

> On Mon, Apr 8, 2013 at 12:13 PM, Felipe Contreras
>  wrote:
>
>> --- a/contrib/remote-helpers/git-remote-hg
>> +++ b/contrib/remote-helpers/git-remote-hg
>
>> @@ -731,6 +722,26 @@ def do_export(parser):
>>  if peer:
>>  parser.repo.push(peer, force=False)
>>
>> +# handle bookmarks
>> +for bmark, node in p_bmarks:
>> +ref = 'refs/heads' + bmark
>
> This should be:
>
> ref = 'refs/heads/' + bmark
>
> Should I reroll?

I'd appreciate it if you can reroll the entire thing.  That way, I
do not have to keep careful track of which one can be reused and
which need to be replaced.

Thanks.

--
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 08/20] remote-hg: split bookmark handling

2013-04-10 Thread Felipe Contreras
On Mon, Apr 8, 2013 at 12:13 PM, Felipe Contreras
 wrote:

> --- a/contrib/remote-helpers/git-remote-hg
> +++ b/contrib/remote-helpers/git-remote-hg

> @@ -731,6 +722,26 @@ def do_export(parser):
>  if peer:
>  parser.repo.push(peer, force=False)
>
> +# handle bookmarks
> +for bmark, node in p_bmarks:
> +ref = 'refs/heads' + bmark

This should be:

ref = 'refs/heads/' + bmark

Should I reroll?

--
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 08/20] remote-hg: split bookmark handling

2013-04-08 Thread Felipe Contreras
Will be useful for remote bookmarks.

Signed-off-by: Felipe Contreras 
---
 contrib/remote-helpers/git-remote-hg | 39 +++-
 1 file changed, 25 insertions(+), 14 deletions(-)

diff --git a/contrib/remote-helpers/git-remote-hg 
b/contrib/remote-helpers/git-remote-hg
index 874ccd4..6901689 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -685,6 +685,8 @@ def parse_tag(parser):
 def do_export(parser):
 global parsed_refs, bmarks, peer
 
+p_bmarks = []
+
 parser.next()
 
 for line in parser.each_block('done'):
@@ -706,20 +708,9 @@ def do_export(parser):
 pass
 elif ref.startswith('refs/heads/'):
 bmark = ref[len('refs/heads/'):]
-if bmark in bmarks:
-old = bmarks[bmark].hex()
-else:
-old = ''
-
-if bmark == 'master' and 'master' not in parser.repo._bookmarks:
-# fake bookmark
-print "ok %s" % ref
-continue
-
-if not bookmarks.pushbookmark(parser.repo, bmark, old, node):
-print "error %s" % ref
-continue
-
+p_bmarks.append((bmark, node))
+# handle below
+continue
 elif ref.startswith('refs/tags/'):
 tag = ref[len('refs/tags/'):]
 parser.repo.tag([tag], node, None, True, None, {})
@@ -731,6 +722,26 @@ def do_export(parser):
 if peer:
 parser.repo.push(peer, force=False)
 
+# handle bookmarks
+for bmark, node in p_bmarks:
+ref = 'refs/heads' + bmark
+
+if bmark in bmarks:
+old = bmarks[bmark].hex()
+else:
+old = ''
+
+if bmark == 'master' and 'master' not in parser.repo._bookmarks:
+# fake bookmark
+print "ok %s" % ref
+continue
+
+if not bookmarks.pushbookmark(parser.repo, bmark, old, node):
+print "error %s" % ref
+continue
+
+print "ok %s" % ref
+
 print
 
 def fix_path(alias, repo, orig_url):
-- 
1.8.2

--
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