{"thread":{"id":"33434","subject":"[PATCH v3 00/20] remote-hg: general updates","startedAt":"2013-04-08T17:13:14Z","lastAt":"2013-04-10T19:36:43Z","messageCount":24,"participants":["Felipe Contreras","Junio C Hamano"],"isPatch":true,"patchVersion":3,"patchTotal":20},"messages":[{"id":"213534","messageId":"1365441214-21096-1-git-send-email-felipe.contreras@gmail.com","threadId":"33434","inReplyTo":null,"subject":"[PATCH v3 00/20] remote-hg: general updates","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-08T17:13:14Z","receivedAt":"2013-04-08T17:13:14Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Hi,\n\nSince forced pushes make some people nervous, this new patch series adds a\nconfiguration variable. Also, I added a few more patches that should be safe,\nfix important issues and/or add nice features.\n\nI'm still holding on to the ones that I consider less safe.\n\nDusty Phillips (2):\n  remote-hg: add missing config variable in doc\n  remote-hg: push to the appropriate branch\n\nFelipe Contreras (15):\n  remote-hg: trivial cleanups\n  remote-hg: properly report errors on bookmark pushes\n  remote-hg: make sure fake bookmarks are updated\n  remote-hg: trivial test cleanups\n  remote-hg: redirect buggy mercurial output\n  remote-hg: split bookmark handling\n  remote-hg: refactor export\n  remote-hg: update remote bookmarks\n  remote-hg: update tags globally\n  remote-hg: force remote push\n  remote-hg: show more proper errors\n  remote-hg: add basic author tests\n  remote-hg: add simple mail test\n  remote-hg: fix bad state issue\n  remote-hg: fix bad file paths\n\nPeter van Zetten (1):\n  remote-hg: fix for files with spaces\n\nSimon Ruderich (2):\n  remote-hg: add 'insecure' option\n  remote-hg: document location of stored hg repository\n\n contrib/remote-helpers/git-remote-hg     | 122 +++++++++++++++++++++++++------\n contrib/remote-helpers/test-hg-bidi.sh   |   6 +-\n contrib/remote-helpers/test-hg-hg-git.sh |   4 +-\n contrib/remote-helpers/test-hg.sh        |  36 +++++++++\n 4 files changed, 141 insertions(+), 27 deletions(-)\n\n-- \n1.8.2\n"},{"id":"213554","messageId":"1365441214-21096-2-git-send-email-felipe.contreras@gmail.com","threadId":"33434","inReplyTo":"1365441214-21096-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v3 01/20] remote-hg: trivial cleanups","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-08T17:13:15Z","receivedAt":"2013-04-08T17:13:15Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-hg | 10 +++++-----\n 1 file changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex 328c2dc..d0dfb1e 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -531,7 +531,6 @@ def parse_blob(parser):\n     data = parser.get_data()\n     blob_marks[mark] = data\n     parser.next()\n-    return\n \n def get_merge_files(repo, p1, p2, files):\n     for e in repo[p1].files():\n@@ -542,7 +541,7 @@ def get_merge_files(repo, p1, p2, files):\n             files[e] = f\n \n def parse_commit(parser):\n-    global marks, blob_marks, bmarks, parsed_refs\n+    global marks, blob_marks, parsed_refs\n     global mode\n \n     from_mark = merge_mark = None\n@@ -647,10 +646,11 @@ def parse_commit(parser):\n     rev = repo[node].rev()\n \n     parsed_refs[ref] = node\n-\n     marks.new_mark(rev, commit_mark)\n \n def parse_reset(parser):\n+    global parsed_refs\n+\n     ref = parser[1]\n     parser.next()\n     # ugh\n@@ -715,11 +715,11 @@ def do_export(parser):\n             continue\n         print \"ok %s\" % ref\n \n-    print\n-\n     if peer:\n         parser.repo.push(peer, force=False)\n \n+    print\n+\n def fix_path(alias, repo, orig_url):\n     repo_url = util.url(repo.url())\n     url = util.url(orig_url)\n-- \n1.8.2\n"},{"id":"213535","messageId":"1365441214-21096-3-git-send-email-felipe.contreras@gmail.com","threadId":"33434","inReplyTo":"1365441214-21096-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v3 02/20] remote-hg: add missing config variable in doc","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-08T17:13:16Z","receivedAt":"2013-04-08T17:13:16Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"From: Dusty Phillips <dusty@linux.ca>\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-hg | 4 ++++\n 1 file changed, 4 insertions(+)\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex d0dfb1e..844ec50 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -23,6 +23,10 @@ import urllib\n # If you want to switch to hg-git compatibility mode:\n # git config --global remote-hg.hg-git-compat true\n #\n+# If you are not in hg-git-compat mode and want to disable the tracking of\n+# named branches:\n+# git config --global remote-hg.track-branches false\n+#\n # git:\n # Sensible defaults for git.\n # hg bookmarks are exported as git branches, hg branches are prefixed\n-- \n1.8.2\n"},{"id":"213536","messageId":"1365441214-21096-4-git-send-email-felipe.contreras@gmail.com","threadId":"33434","inReplyTo":"1365441214-21096-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v3 03/20] remote-hg: properly report errors on bookmark pushes","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-08T17:13:17Z","receivedAt":"2013-04-08T17:13:17Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-hg | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex 844ec50..19eb4db 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -710,6 +710,7 @@ def do_export(parser):\n             else:\n                 old = ''\n             if not bookmarks.pushbookmark(parser.repo, bmark, old, node):\n+                print \"error %s\" % ref\n                 continue\n         elif ref.startswith('refs/tags/'):\n             tag = ref[len('refs/tags/'):]\n-- \n1.8.2\n"},{"id":"213539","messageId":"1365441214-21096-5-git-send-email-felipe.contreras@gmail.com","threadId":"33434","inReplyTo":"1365441214-21096-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v3 04/20] remote-hg: fix for files with spaces","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-08T17:13:18Z","receivedAt":"2013-04-08T17:13:18Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"From: Peter van Zetten <peter.van.zetten@cgi.com>\n\nSet the maximum number of splits to make when dividing the diff stat\nlines based on space characters.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-hg | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex 19eb4db..c6a1a47 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -578,7 +578,7 @@ def parse_commit(parser):\n             mark = int(mark_ref[1:])\n             f = { 'mode' : hgmode(m), 'data' : blob_marks[mark] }\n         elif parser.check('D'):\n-            t, path = line.split(' ')\n+            t, path = line.split(' ', 1)\n             f = { 'deleted' : True }\n         else:\n             die('Unknown file command: %s' % line)\n@@ -625,7 +625,7 @@ def parse_commit(parser):\n         i = data.find('\\n--HG--\\n')\n         if i >= 0:\n             tmp = data[i + len('\\n--HG--\\n'):].strip()\n-            for k, v in [e.split(' : ') for e in tmp.split('\\n')]:\n+            for k, v in [e.split(' : ', 1) for e in tmp.split('\\n')]:\n                 if k == 'rename':\n                     old, new = v.split(' => ', 1)\n                     files[new]['rename'] = old\n-- \n1.8.2\n"},{"id":"213540","messageId":"1365441214-21096-6-git-send-email-felipe.contreras@gmail.com","threadId":"33434","inReplyTo":"1365441214-21096-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v3 05/20] remote-hg: make sure fake bookmarks are updated","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-08T17:13:19Z","receivedAt":"2013-04-08T17:13:19Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-hg     | 7 +++++++\n contrib/remote-helpers/test-hg-bidi.sh   | 1 +\n contrib/remote-helpers/test-hg-hg-git.sh | 1 +\n 3 files changed, 9 insertions(+)\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex c6a1a47..b200e60 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -709,9 +709,16 @@ def do_export(parser):\n                 old = bmarks[bmark].hex()\n             else:\n                 old = ''\n+\n+            if bmark == 'master' and 'master' not in parser.repo._bookmarks:\n+                # fake bookmark\n+                print \"ok %s\" % ref\n+                continue\n+\n             if not bookmarks.pushbookmark(parser.repo, bmark, old, node):\n                 print \"error %s\" % ref\n                 continue\n+\n         elif ref.startswith('refs/tags/'):\n             tag = ref[len('refs/tags/'):]\n             parser.repo.tag([tag], node, None, True, None, {})\ndiff --git a/contrib/remote-helpers/test-hg-bidi.sh b/contrib/remote-helpers/test-hg-bidi.sh\nindex 1d61982..fe38e49 100755\n--- a/contrib/remote-helpers/test-hg-bidi.sh\n+++ b/contrib/remote-helpers/test-hg-bidi.sh\n@@ -30,6 +30,7 @@ git_clone () {\n hg_clone () {\n \t(\n \thg init $2 &&\n+\thg -R $2 bookmark -i master &&\n \tcd $1 &&\n \tgit push -q \"hg::$PWD/../$2\" 'refs/tags/*:refs/tags/*' 'refs/heads/*:refs/heads/*'\n \t) &&\ndiff --git a/contrib/remote-helpers/test-hg-hg-git.sh b/contrib/remote-helpers/test-hg-hg-git.sh\nindex 3f253b7..e116cb0 100755\n--- a/contrib/remote-helpers/test-hg-hg-git.sh\n+++ b/contrib/remote-helpers/test-hg-hg-git.sh\n@@ -35,6 +35,7 @@ git_clone_git () {\n hg_clone_git () {\n \t(\n \thg init $2 &&\n+\thg -R $2 bookmark -i master &&\n \tcd $1 &&\n \tgit push -q \"hg::$PWD/../$2\" 'refs/tags/*:refs/tags/*' 'refs/heads/*:refs/heads/*'\n \t) &&\n-- \n1.8.2\n"},{"id":"213538","messageId":"1365441214-21096-7-git-send-email-felipe.contreras@gmail.com","threadId":"33434","inReplyTo":"1365441214-21096-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v3 06/20] remote-hg: trivial test cleanups","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-08T17:13:20Z","receivedAt":"2013-04-08T17:13:20Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/test-hg-bidi.sh   | 5 ++---\n contrib/remote-helpers/test-hg-hg-git.sh | 3 +--\n 2 files changed, 3 insertions(+), 5 deletions(-)\n\ndiff --git a/contrib/remote-helpers/test-hg-bidi.sh b/contrib/remote-helpers/test-hg-bidi.sh\nindex fe38e49..a3c88f6 100755\n--- a/contrib/remote-helpers/test-hg-bidi.sh\n+++ b/contrib/remote-helpers/test-hg-bidi.sh\n@@ -22,7 +22,6 @@ fi\n \n # clone to a git repo\n git_clone () {\n-\thg -R $1 bookmark -f -r tip master &&\n \tgit clone -q \"hg::$PWD/$1\" $2\n }\n \n@@ -201,8 +200,8 @@ test_expect_success 'hg branch' '\n \thg_push hgrepo gitrepo &&\n \thg_clone gitrepo hgrepo2 &&\n \n-\t: TODO, avoid \"master\" bookmark &&\n-\t(cd hgrepo2 && hg checkout gamma) &&\n+\t: Back to the common revision &&\n+\t(cd hgrepo && hg checkout default) &&\n \n \thg_log hgrepo > expected &&\n \thg_log hgrepo2 > actual &&\ndiff --git a/contrib/remote-helpers/test-hg-hg-git.sh b/contrib/remote-helpers/test-hg-hg-git.sh\nindex e116cb0..73ae18d 100755\n--- a/contrib/remote-helpers/test-hg-hg-git.sh\n+++ b/contrib/remote-helpers/test-hg-hg-git.sh\n@@ -27,7 +27,6 @@ fi\n \n # clone to a git repo with git\n git_clone_git () {\n-\thg -R $1 bookmark -f -r tip master &&\n \tgit clone -q \"hg::$PWD/$1\" $2\n }\n \n@@ -48,7 +47,7 @@ git_clone_hg () {\n \t(\n \tgit init -q $2 &&\n \tcd $1 &&\n-\thg bookmark -f -r tip master &&\n+\thg bookmark -i -f -r tip master &&\n \thg -q push -r master ../$2 || true\n \t)\n }\n-- \n1.8.2\n"},{"id":"213551","messageId":"1365441214-21096-8-git-send-email-felipe.contreras@gmail.com","threadId":"33434","inReplyTo":"1365441214-21096-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v3 07/20] remote-hg: redirect buggy mercurial output","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-08T17:13:21Z","receivedAt":"2013-04-08T17:13:21Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Mercurial emits messages like \"searching for changes\", \"no changes\nfound\", etc. meant for the use of its own UI layer, which break the pipe\nbetween transport helper and remote helper.\n\nSince there's no way to silence Mercurial, let's redirect to standard\nerror.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-hg | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex b200e60..874ccd4 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -271,6 +271,7 @@ def get_repo(url, alias):\n \n     myui = ui.ui()\n     myui.setconfig('ui', 'interactive', 'off')\n+    myui.fout = sys.stderr\n \n     if hg.islocal(url):\n         repo = hg.repository(myui, url)\n-- \n1.8.2\n"},{"id":"213537","messageId":"1365441214-21096-9-git-send-email-felipe.contreras@gmail.com","threadId":"33434","inReplyTo":"1365441214-21096-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v3 08/20] remote-hg: split bookmark handling","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-08T17:13:22Z","receivedAt":"2013-04-08T17:13:22Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Will be useful for remote bookmarks.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-hg | 39 +++++++++++++++++++++++-------------\n 1 file changed, 25 insertions(+), 14 deletions(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex 874ccd4..6901689 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -685,6 +685,8 @@ def parse_tag(parser):\n def do_export(parser):\n     global parsed_refs, bmarks, peer\n \n+    p_bmarks = []\n+\n     parser.next()\n \n     for line in parser.each_block('done'):\n@@ -706,20 +708,9 @@ def do_export(parser):\n             pass\n         elif ref.startswith('refs/heads/'):\n             bmark = ref[len('refs/heads/'):]\n-            if bmark in bmarks:\n-                old = bmarks[bmark].hex()\n-            else:\n-                old = ''\n-\n-            if bmark == 'master' and 'master' not in parser.repo._bookmarks:\n-                # fake bookmark\n-                print \"ok %s\" % ref\n-                continue\n-\n-            if not bookmarks.pushbookmark(parser.repo, bmark, old, node):\n-                print \"error %s\" % ref\n-                continue\n-\n+            p_bmarks.append((bmark, node))\n+            # handle below\n+            continue\n         elif ref.startswith('refs/tags/'):\n             tag = ref[len('refs/tags/'):]\n             parser.repo.tag([tag], node, None, True, None, {})\n@@ -731,6 +722,26 @@ def do_export(parser):\n     if peer:\n         parser.repo.push(peer, force=False)\n \n+    # handle bookmarks\n+    for bmark, node in p_bmarks:\n+        ref = 'refs/heads' + bmark\n+\n+        if bmark in bmarks:\n+            old = bmarks[bmark].hex()\n+        else:\n+            old = ''\n+\n+        if bmark == 'master' and 'master' not in parser.repo._bookmarks:\n+            # fake bookmark\n+            print \"ok %s\" % ref\n+            continue\n+\n+        if not bookmarks.pushbookmark(parser.repo, bmark, old, node):\n+            print \"error %s\" % ref\n+            continue\n+\n+        print \"ok %s\" % ref\n+\n     print\n \n def fix_path(alias, repo, orig_url):\n-- \n1.8.2\n"},{"id":"213541","messageId":"1365441214-21096-10-git-send-email-felipe.contreras@gmail.com","threadId":"33434","inReplyTo":"1365441214-21096-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v3 09/20] remote-hg: refactor export","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-08T17:13:23Z","receivedAt":"2013-04-08T17:13:23Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"No functional changes.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-hg | 20 ++++++++++++--------\n 1 file changed, 12 insertions(+), 8 deletions(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex 6901689..c741f13 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -9,7 +9,7 @@\n # Then you can clone with:\n # git clone hg::/path/to/mercurial/repo/\n \n-from mercurial import hg, ui, bookmarks, context, util, encoding\n+from mercurial import hg, ui, bookmarks, context, util, encoding, node\n \n import re\n import sys\n@@ -60,6 +60,9 @@ def hgmode(mode):\n     m = { '100755': 'x', '120000': 'l' }\n     return m.get(mode, '')\n \n+def hghex(node):\n+    return hg.node.hex(node)\n+\n def get_config(config):\n     cmd = ['git', 'config', '--get', config]\n     process = subprocess.Popen(cmd, stdout=subprocess.PIPE)\n@@ -705,19 +708,18 @@ def do_export(parser):\n \n     for ref, node in parsed_refs.iteritems():\n         if ref.startswith('refs/heads/branches'):\n-            pass\n+            print \"ok %s\" % ref\n         elif ref.startswith('refs/heads/'):\n             bmark = ref[len('refs/heads/'):]\n             p_bmarks.append((bmark, node))\n-            # handle below\n             continue\n         elif ref.startswith('refs/tags/'):\n             tag = ref[len('refs/tags/'):]\n             parser.repo.tag([tag], node, None, True, None, {})\n+            print \"ok %s\" % ref\n         else:\n             # transport-helper/fast-export bugs\n             continue\n-        print \"ok %s\" % ref\n \n     if peer:\n         parser.repo.push(peer, force=False)\n@@ -725,6 +727,7 @@ def do_export(parser):\n     # handle bookmarks\n     for bmark, node in p_bmarks:\n         ref = 'refs/heads' + bmark\n+        new = hghex(node)\n \n         if bmark in bmarks:\n             old = bmarks[bmark].hex()\n@@ -733,10 +736,11 @@ def do_export(parser):\n \n         if bmark == 'master' and 'master' not in parser.repo._bookmarks:\n             # fake bookmark\n-            print \"ok %s\" % ref\n-            continue\n-\n-        if not bookmarks.pushbookmark(parser.repo, bmark, old, node):\n+            pass\n+        elif bookmarks.pushbookmark(parser.repo, bmark, old, new):\n+            # updated locally\n+            pass\n+        else:\n             print \"error %s\" % ref\n             continue\n \n-- \n1.8.2\n"},{"id":"213542","messageId":"1365441214-21096-11-git-send-email-felipe.contreras@gmail.com","threadId":"33434","inReplyTo":"1365441214-21096-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v3 10/20] remote-hg: update remote bookmarks","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-08T17:13:24Z","receivedAt":"2013-04-08T17:13:24Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-hg | 5 +++++\n 1 file changed, 5 insertions(+)\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex c741f13..b54de1e 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -744,6 +744,11 @@ def do_export(parser):\n             print \"error %s\" % ref\n             continue\n \n+        if peer:\n+            if not peer.pushkey('bookmarks', bmark, old, new):\n+                print \"error %s\" % ref\n+                continue\n+\n         print \"ok %s\" % ref\n \n     print\n-- \n1.8.2\n"},{"id":"213543","messageId":"1365441214-21096-12-git-send-email-felipe.contreras@gmail.com","threadId":"33434","inReplyTo":"1365441214-21096-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v3 11/20] remote-hg: update tags globally","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-08T17:13:25Z","receivedAt":"2013-04-08T17:13:25Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-hg | 6 +++++-\n 1 file changed, 5 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex b54de1e..bccdf4e 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -715,7 +715,11 @@ def do_export(parser):\n             continue\n         elif ref.startswith('refs/tags/'):\n             tag = ref[len('refs/tags/'):]\n-            parser.repo.tag([tag], node, None, True, None, {})\n+            if mode == 'git':\n+                msg = 'Added tag %s for changeset %s' % (tag, hghex(node[:6]));\n+                parser.repo.tag([tag], node, msg, False, None, {})\n+            else:\n+                parser.repo.tag([tag], node, None, True, None, {})\n             print \"ok %s\" % ref\n         else:\n             # transport-helper/fast-export bugs\n-- \n1.8.2\n"},{"id":"213544","messageId":"1365441214-21096-13-git-send-email-felipe.contreras@gmail.com","threadId":"33434","inReplyTo":"1365441214-21096-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v3 12/20] remote-hg: push to the appropriate branch","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-08T17:13:26Z","receivedAt":"2013-04-08T17:13:26Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"From: Dusty Phillips <dusty@linux.ca>\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-hg | 4 ++++\n 1 file changed, 4 insertions(+)\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex bccdf4e..8f6809a 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -625,6 +625,10 @@ def parse_commit(parser):\n     if merge_mark:\n         get_merge_files(repo, p1, p2, files)\n \n+    # Check if the ref is supposed to be a named branch\n+    if ref.startswith('refs/heads/branches/'):\n+        extra['branch'] = ref.replace('refs/heads/branches/', '')\n+\n     if mode == 'hg':\n         i = data.find('\\n--HG--\\n')\n         if i >= 0:\n-- \n1.8.2\n"},{"id":"213546","messageId":"1365441214-21096-14-git-send-email-felipe.contreras@gmail.com","threadId":"33434","inReplyTo":"1365441214-21096-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v3 13/20] remote-hg: force remote push","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-08T17:13:27Z","receivedAt":"2013-04-08T17:13:27Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Ideally we shouldn't do this, as it's not recommended in mercurial\ndocumentation, but there's no other way to push multiple bookmarks (on\nthe same branch), which would be the behavior most similar to git.\n\nAt the same time, add a configuration option for the people that don't\nwant to risk creating new remote heads.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-hg | 11 +++++++++--\n 1 file changed, 9 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex 8f6809a..9fb4d8b 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -27,6 +27,9 @@ import urllib\n # named branches:\n # git config --global remote-hg.track-branches false\n #\n+# If you don't want to force pushes (and thus risk creating new remote heads):\n+# git config --global remote-hg.force-push false\n+#\n # git:\n # Sensible defaults for git.\n # hg bookmarks are exported as git branches, hg branches are prefixed\n@@ -730,7 +733,7 @@ def do_export(parser):\n             continue\n \n     if peer:\n-        parser.repo.push(peer, force=False)\n+        parser.repo.push(peer, force=force_push)\n \n     # handle bookmarks\n     for bmark, node in p_bmarks:\n@@ -773,7 +776,7 @@ def main(args):\n     global prefix, dirname, branches, bmarks\n     global marks, blob_marks, parsed_refs\n     global peer, mode, bad_mail, bad_name\n-    global track_branches\n+    global track_branches, force_push\n \n     alias = args[1]\n     url = args[2]\n@@ -781,12 +784,16 @@ def main(args):\n \n     hg_git_compat = False\n     track_branches = True\n+    force_push = True\n+\n     try:\n         if get_config('remote-hg.hg-git-compat') == 'true\\n':\n             hg_git_compat = True\n             track_branches = False\n         if get_config('remote-hg.track-branches') == 'false\\n':\n             track_branches = False\n+        if get_config('remote-hg.force-push') == 'false\\n':\n+            force_push = False\n     except subprocess.CalledProcessError:\n         pass\n \n-- \n1.8.2\n"},{"id":"213552","messageId":"1365441214-21096-15-git-send-email-felipe.contreras@gmail.com","threadId":"33434","inReplyTo":"1365441214-21096-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v3 14/20] remote-hg: show more proper errors","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-08T17:13:28Z","receivedAt":"2013-04-08T17:13:28Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"When cloning or pushing fails, we don't want to show a stack-trace.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-hg | 12 +++++++++---\n 1 file changed, 9 insertions(+), 3 deletions(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex 9fb4d8b..078d3e8 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -9,7 +9,7 @@\n # Then you can clone with:\n # git clone hg::/path/to/mercurial/repo/\n \n-from mercurial import hg, ui, bookmarks, context, util, encoding, node\n+from mercurial import hg, ui, bookmarks, context, util, encoding, node, error\n \n import re\n import sys\n@@ -284,11 +284,17 @@ def get_repo(url, alias):\n     else:\n         local_path = os.path.join(dirname, 'clone')\n         if not os.path.exists(local_path):\n-            peer, dstpeer = hg.clone(myui, {}, url, local_path, update=False, pull=True)\n+            try:\n+                peer, dstpeer = hg.clone(myui, {}, url, local_path, update=True, pull=True)\n+            except:\n+                die('Repository error')\n             repo = dstpeer.local()\n         else:\n             repo = hg.repository(myui, local_path)\n-            peer = hg.peer(myui, {}, url)\n+            try:\n+                peer = hg.peer(myui, {}, url)\n+            except:\n+                die('Repository error')\n             repo.pull(peer, heads=None, force=True)\n \n     return repo\n-- \n1.8.2\n"},{"id":"213553","messageId":"1365441214-21096-16-git-send-email-felipe.contreras@gmail.com","threadId":"33434","inReplyTo":"1365441214-21096-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v3 15/20] remote-hg: add basic author tests","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-08T17:13:29Z","receivedAt":"2013-04-08T17:13:29Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/test-hg.sh | 35 +++++++++++++++++++++++++++++++++++\n 1 file changed, 35 insertions(+)\n\ndiff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh\nindex 5f81dfa..62e3a47 100755\n--- a/contrib/remote-helpers/test-hg.sh\n+++ b/contrib/remote-helpers/test-hg.sh\n@@ -118,4 +118,39 @@ test_expect_success 'update bookmark' '\n   hg -R hgrepo bookmarks | grep \"devel\\s\\+3:\"\n '\n \n+author_test () {\n+  echo $1 >> content &&\n+  hg commit -u \"$2\" -m \"add $1\" &&\n+  echo \"$3\" >> ../expected\n+}\n+\n+test_expect_success 'authors' '\n+  mkdir -p tmp && cd tmp &&\n+  test_when_finished \"cd .. && rm -rf tmp\" &&\n+\n+  (\n+  hg init hgrepo &&\n+  cd hgrepo &&\n+\n+  touch content &&\n+  hg add content &&\n+\n+  author_test alpha \"\" \"H G Wells <wells@example.com>\" &&\n+  author_test beta \"test\" \"test <unknown>\" &&\n+  author_test beta \"test <test@example.com> (comment)\" \"test <unknown>\" &&\n+  author_test gamma \"<test@example.com>\" \"Unknown <test@example.com>\" &&\n+  author_test delta \"name<test@example.com>\" \"name <test@example.com>\" &&\n+  author_test epsilon \"name <test@example.com\" \"name <unknown>\" &&\n+  author_test zeta \" test \" \"test <unknown>\" &&\n+  author_test eta \"test < test@example.com >\" \"test <test@example.com>\" &&\n+  author_test theta \"test >test@example.com>\" \"test <unknown>\" &&\n+  author_test iota \"test < test <at> example <dot> com>\" \"test <unknown>\"\n+  ) &&\n+\n+  git clone \"hg::$PWD/hgrepo\" gitrepo &&\n+  git --git-dir=gitrepo/.git log --reverse --format=\"%an <%ae>\" > actual &&\n+\n+  test_cmp expected actual\n+'\n+\n test_done\n-- \n1.8.2\n"},{"id":"213545","messageId":"1365441214-21096-17-git-send-email-felipe.contreras@gmail.com","threadId":"33434","inReplyTo":"1365441214-21096-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v3 16/20] remote-hg: add simple mail test","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-08T17:13:30Z","receivedAt":"2013-04-08T17:13:30Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/test-hg.sh | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh\nindex 62e3a47..6a1e4b1 100755\n--- a/contrib/remote-helpers/test-hg.sh\n+++ b/contrib/remote-helpers/test-hg.sh\n@@ -144,7 +144,8 @@ test_expect_success 'authors' '\n   author_test zeta \" test \" \"test <unknown>\" &&\n   author_test eta \"test < test@example.com >\" \"test <test@example.com>\" &&\n   author_test theta \"test >test@example.com>\" \"test <unknown>\" &&\n-  author_test iota \"test < test <at> example <dot> com>\" \"test <unknown>\"\n+  author_test iota \"test < test <at> example <dot> com>\" \"test <unknown>\" &&\n+  author_test kappa \"test@example.com\" \"test@example.com <unknown>\"\n   ) &&\n \n   git clone \"hg::$PWD/hgrepo\" gitrepo &&\n-- \n1.8.2\n"},{"id":"213548","messageId":"1365441214-21096-18-git-send-email-felipe.contreras@gmail.com","threadId":"33434","inReplyTo":"1365441214-21096-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v3 17/20] remote-hg: add 'insecure' option","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-08T17:13:31Z","receivedAt":"2013-04-08T17:13:31Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"From: Simon Ruderich <simon@ruderich.org>\n\nIf set to true acts as hg's clone/pull --insecure option.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-hg | 9 +++++++++\n 1 file changed, 9 insertions(+)\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex 078d3e8..2f642a6 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -30,6 +30,9 @@ import urllib\n # If you don't want to force pushes (and thus risk creating new remote heads):\n # git config --global remote-hg.force-push false\n #\n+# If you want the equivalent of hg's clone/pull--insecure option:\n+# git config remote-hg.insecure true\n+#\n # git:\n # Sensible defaults for git.\n # hg bookmarks are exported as git branches, hg branches are prefixed\n@@ -279,6 +282,12 @@ def get_repo(url, alias):\n     myui.setconfig('ui', 'interactive', 'off')\n     myui.fout = sys.stderr\n \n+    try:\n+        if get_config('remote-hg.insecure') == 'true\\n':\n+            myui.setconfig('web', 'cacerts', '')\n+    except subprocess.CalledProcessError:\n+        pass\n+\n     if hg.islocal(url):\n         repo = hg.repository(myui, url)\n     else:\n-- \n1.8.2\n"},{"id":"213547","messageId":"1365441214-21096-19-git-send-email-felipe.contreras@gmail.com","threadId":"33434","inReplyTo":"1365441214-21096-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v3 18/20] remote-hg: fix bad state issue","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-08T17:13:32Z","receivedAt":"2013-04-08T17:13:32Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"The problem reportedly happened after doing a push that fails, the abort\ncauses the state of remote-hg to go bad, this happens because\nremote-hg's marks are not stored, but 'git fast-export' marks are.\n\nEnsure that the marks are _always_ stored.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-hg | 8 +++++++-\n 1 file changed, 7 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex 2f642a6..a02ec68 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -18,6 +18,7 @@ import json\n import shutil\n import subprocess\n import urllib\n+import atexit\n \n #\n # If you want to switch to hg-git compatibility mode:\n@@ -791,7 +792,7 @@ def main(args):\n     global prefix, dirname, branches, bmarks\n     global marks, blob_marks, parsed_refs\n     global peer, mode, bad_mail, bad_name\n-    global track_branches, force_push\n+    global track_branches, force_push, is_tmp\n \n     alias = args[1]\n     url = args[2]\n@@ -833,6 +834,7 @@ def main(args):\n     bmarks = {}\n     blob_marks = {}\n     parsed_refs = {}\n+    marks = None\n \n     repo = get_repo(url, alias)\n     prefix = 'refs/hg/%s' % alias\n@@ -860,9 +862,13 @@ def main(args):\n             die('unhandled command: %s' % line)\n         sys.stdout.flush()\n \n+def bye():\n+    if not marks:\n+        return\n     if not is_tmp:\n         marks.store()\n     else:\n         shutil.rmtree(dirname)\n \n+atexit.register(bye)\n sys.exit(main(sys.argv))\n-- \n1.8.2\n"},{"id":"213550","messageId":"1365441214-21096-20-git-send-email-felipe.contreras@gmail.com","threadId":"33434","inReplyTo":"1365441214-21096-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v3 19/20] remote-hg: document location of stored hg repository","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-08T17:13:33Z","receivedAt":"2013-04-08T17:13:33Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"From: Simon Ruderich <simon@ruderich.org>\n\nSigned-off-by: Simon Ruderich <simon@ruderich.org>\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-hg | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex a02ec68..37e6aec 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -8,6 +8,9 @@\n # Just copy to your ~/bin, or anywhere in your $PATH.\n # Then you can clone with:\n # git clone hg::/path/to/mercurial/repo/\n+#\n+# For remote repositories a local clone is stored in\n+# \"$GIT_DIR/hg/origin/clone/.hg/\".\n \n from mercurial import hg, ui, bookmarks, context, util, encoding, node, error\n \n-- \n1.8.2\n"},{"id":"213549","messageId":"1365441214-21096-21-git-send-email-felipe.contreras@gmail.com","threadId":"33434","inReplyTo":"1365441214-21096-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v3 20/20] remote-hg: fix bad file paths","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-08T17:13:34Z","receivedAt":"2013-04-08T17:13:34Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Mercurial allows absolute file paths, and Git doesn't like that.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-hg | 10 ++++++++--\n 1 file changed, 8 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex 37e6aec..d45f16d 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -205,9 +205,15 @@ class Parser:\n         tz = ((tz / 100) * 3600) + ((tz % 100) * 60)\n         return (user, int(date), -tz)\n \n+def fix_file_path(path):\n+    if not os.path.isabs(path):\n+        return path\n+    return os.path.relpath(path, '/')\n+\n def export_file(fc):\n     d = fc.data()\n-    print \"M %s inline %s\" % (gitmode(fc.flags()), fc.path())\n+    path = fix_file_path(fc.path())\n+    print \"M %s inline %s\" % (gitmode(fc.flags()), path)\n     print \"data %d\" % len(d)\n     print d\n \n@@ -401,7 +407,7 @@ def export_ref(repo, name, kind, head):\n         for f in modified:\n             export_file(c.filectx(f))\n         for f in removed:\n-            print \"D %s\" % (f)\n+            print \"D %s\" % (fix_file_path(f))\n         print\n \n         count += 1\n-- \n1.8.2\n"},{"id":"213811","messageId":"CAMP44s3VcUyQUNBw+19O-_nf9HPWt=2uc35Keh6Z0jcgFF=Y7A@mail.gmail.com","threadId":"33434","inReplyTo":"1365441214-21096-9-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH v3 08/20] remote-hg: split bookmark handling","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-10T19:14:32Z","receivedAt":"2013-04-10T19:14:32Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Mon, Apr 8, 2013 at 12:13 PM, Felipe Contreras\n<felipe.contreras@gmail.com> wrote:\n\n> --- a/contrib/remote-helpers/git-remote-hg\n> +++ b/contrib/remote-helpers/git-remote-hg\n\n> @@ -731,6 +722,26 @@ def do_export(parser):\n>      if peer:\n>          parser.repo.push(peer, force=False)\n>\n> +    # handle bookmarks\n> +    for bmark, node in p_bmarks:\n> +        ref = 'refs/heads' + bmark\n\nThis should be:\n\nref = 'refs/heads/' + bmark\n\nShould I reroll?\n\n--\nFelipe Contreras\n"},{"id":"213812","messageId":"CAMP44s06gKHiEuZF41OkE7tsBn5PAkyGXvmoiqvN1keKFZczJQ@mail.gmail.com","threadId":"33434","inReplyTo":"1365441214-21096-13-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH v3 12/20] remote-hg: push to the appropriate branch","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-10T19:15:53Z","receivedAt":"2013-04-10T19:15:53Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Mon, Apr 8, 2013 at 12:13 PM, Felipe Contreras\n<felipe.contreras@gmail.com> wrote:\n\n> --- a/contrib/remote-helpers/git-remote-hg\n> +++ b/contrib/remote-helpers/git-remote-hg\n> @@ -625,6 +625,10 @@ def parse_commit(parser):\n>      if merge_mark:\n>          get_merge_files(repo, p1, p2, files)\n>\n> +    # Check if the ref is supposed to be a named branch\n> +    if ref.startswith('refs/heads/branches/'):\n> +        extra['branch'] = ref.replace('refs/heads/branches/', '')\n\nThis should be more consistent with the rest of the code:\n\nbranch = ref[len('refs/heads/branches/'):]\n\nShould I reroll?\n\n--\nFelipe Contreras\n"},{"id":"213817","messageId":"7vvc7ukwj8.fsf@alter.siamese.dyndns.org","threadId":"33434","inReplyTo":"CAMP44s3VcUyQUNBw+19O-_nf9HPWt=2uc35Keh6Z0jcgFF=Y7A@mail.gmail.com","subject":"Re: [PATCH v3 08/20] remote-hg: split bookmark handling","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-04-10T19:36:43Z","receivedAt":"2013-04-10T19:36:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> On Mon, Apr 8, 2013 at 12:13 PM, Felipe Contreras\n> <felipe.contreras@gmail.com> wrote:\n>\n>> --- a/contrib/remote-helpers/git-remote-hg\n>> +++ b/contrib/remote-helpers/git-remote-hg\n>\n>> @@ -731,6 +722,26 @@ def do_export(parser):\n>>      if peer:\n>>          parser.repo.push(peer, force=False)\n>>\n>> +    # handle bookmarks\n>> +    for bmark, node in p_bmarks:\n>> +        ref = 'refs/heads' + bmark\n>\n> This should be:\n>\n> ref = 'refs/heads/' + bmark\n>\n> Should I reroll?\n\nI'd appreciate it if you can reroll the entire thing.  That way, I\ndo not have to keep careful track of which one can be reused and\nwhich need to be replaced.\n\nThanks.\n"}]}