{"thread":{"id":"33476","subject":"[PATCH v4 00/21] remote-hg: general updates","startedAt":"2013-04-11T12:22:56Z","lastAt":"2013-05-27T16:49:08Z","messageCount":25,"participants":["Felipe Contreras","Junio C Hamano","Antoine Pelisse"],"isPatch":true,"patchVersion":4,"patchTotal":21},"messages":[{"id":"213932","messageId":"1365682997-11329-1-git-send-email-felipe.contreras@gmail.com","threadId":"33476","inReplyTo":null,"subject":"[PATCH v4 00/21] remote-hg: general updates","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-11T12:22:56Z","receivedAt":"2013-04-11T12:22:56Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Hi,\n\nThis is a reroll of the previous series due to a few minor issues. As the\nprevious version, forced pushes remain a configuration option. Also, I picked\nup a fix for test regarding hg_log() that was sent to the mailing list.\n\nAntoine Pelisse (1):\n  remote-hg: activate graphlog extension for hg_log()\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   |  11 ++-\n contrib/remote-helpers/test-hg-hg-git.sh |   8 +-\n contrib/remote-helpers/test-hg.sh        |  36 +++++++++\n 4 files changed, 148 insertions(+), 29 deletions(-)\n\n-- \n1.8.2.1\n"},{"id":"213933","messageId":"1365682997-11329-2-git-send-email-felipe.contreras@gmail.com","threadId":"33476","inReplyTo":"1365682997-11329-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 01/21] remote-hg: trivial cleanups","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-11T12:22:57Z","receivedAt":"2013-04-11T12:22:57Z","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.1\n"},{"id":"213934","messageId":"1365682997-11329-3-git-send-email-felipe.contreras@gmail.com","threadId":"33476","inReplyTo":"1365682997-11329-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 02/21] remote-hg: add missing config variable in doc","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-11T12:22:58Z","receivedAt":"2013-04-11T12:22:58Z","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.1\n"},{"id":"213935","messageId":"1365682997-11329-4-git-send-email-felipe.contreras@gmail.com","threadId":"33476","inReplyTo":"1365682997-11329-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 03/21] remote-hg: properly report errors on bookmark pushes","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-11T12:22:59Z","receivedAt":"2013-04-11T12:22:59Z","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.1\n"},{"id":"213937","messageId":"1365682997-11329-5-git-send-email-felipe.contreras@gmail.com","threadId":"33476","inReplyTo":"1365682997-11329-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 04/21] remote-hg: fix for files with spaces","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-11T12:23:00Z","receivedAt":"2013-04-11T12:23:00Z","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.1\n"},{"id":"213936","messageId":"1365682997-11329-6-git-send-email-felipe.contreras@gmail.com","threadId":"33476","inReplyTo":"1365682997-11329-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 05/21] remote-hg: make sure fake bookmarks are updated","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-11T12:23:01Z","receivedAt":"2013-04-11T12:23:01Z","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.1\n"},{"id":"213938","messageId":"1365682997-11329-7-git-send-email-felipe.contreras@gmail.com","threadId":"33476","inReplyTo":"1365682997-11329-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 06/21] remote-hg: trivial test cleanups","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-11T12:23:02Z","receivedAt":"2013-04-11T12:23:02Z","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.1\n"},{"id":"213953","messageId":"1365682997-11329-8-git-send-email-felipe.contreras@gmail.com","threadId":"33476","inReplyTo":"1365682997-11329-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 07/21] remote-hg: redirect buggy mercurial output","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-11T12:23:03Z","receivedAt":"2013-04-11T12:23:03Z","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.1\n"},{"id":"213939","messageId":"1365682997-11329-9-git-send-email-felipe.contreras@gmail.com","threadId":"33476","inReplyTo":"1365682997-11329-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 08/21] remote-hg: split bookmark handling","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-11T12:23:04Z","receivedAt":"2013-04-11T12:23:04Z","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..73cd812 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.1\n"},{"id":"213941","messageId":"1365682997-11329-10-git-send-email-felipe.contreras@gmail.com","threadId":"33476","inReplyTo":"1365682997-11329-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 09/21] remote-hg: refactor export","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-11T12:23:05Z","receivedAt":"2013-04-11T12:23:05Z","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 73cd812..3ceec85 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.1\n"},{"id":"213940","messageId":"1365682997-11329-11-git-send-email-felipe.contreras@gmail.com","threadId":"33476","inReplyTo":"1365682997-11329-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 10/21] remote-hg: update remote bookmarks","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-11T12:23:06Z","receivedAt":"2013-04-11T12:23:06Z","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 3ceec85..46cddc9 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.1\n"},{"id":"213942","messageId":"1365682997-11329-12-git-send-email-felipe.contreras@gmail.com","threadId":"33476","inReplyTo":"1365682997-11329-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 11/21] remote-hg: update tags globally","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-11T12:23:07Z","receivedAt":"2013-04-11T12:23:07Z","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 46cddc9..fc04f81 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.1\n"},{"id":"213943","messageId":"1365682997-11329-13-git-send-email-felipe.contreras@gmail.com","threadId":"33476","inReplyTo":"1365682997-11329-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 12/21] remote-hg: push to the appropriate branch","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-11T12:23:08Z","receivedAt":"2013-04-11T12:23:08Z","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 fc04f81..ec599c6 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[len('refs/heads/branches/'):]\n+\n     if mode == 'hg':\n         i = data.find('\\n--HG--\\n')\n         if i >= 0:\n-- \n1.8.2.1\n"},{"id":"213944","messageId":"1365682997-11329-14-git-send-email-felipe.contreras@gmail.com","threadId":"33476","inReplyTo":"1365682997-11329-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 13/21] remote-hg: force remote push","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-11T12:23:09Z","receivedAt":"2013-04-11T12:23:09Z","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 ec599c6..ff89725 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.1\n"},{"id":"213947","messageId":"1365682997-11329-15-git-send-email-felipe.contreras@gmail.com","threadId":"33476","inReplyTo":"1365682997-11329-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 14/21] remote-hg: show more proper errors","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-11T12:23:10Z","receivedAt":"2013-04-11T12:23:10Z","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 ff89725..3ae3598 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.1\n"},{"id":"213945","messageId":"1365682997-11329-16-git-send-email-felipe.contreras@gmail.com","threadId":"33476","inReplyTo":"1365682997-11329-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 15/21] remote-hg: add basic author tests","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-11T12:23:11Z","receivedAt":"2013-04-11T12:23:11Z","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.1\n"},{"id":"213946","messageId":"1365682997-11329-17-git-send-email-felipe.contreras@gmail.com","threadId":"33476","inReplyTo":"1365682997-11329-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 16/21] remote-hg: add simple mail test","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-11T12:23:12Z","receivedAt":"2013-04-11T12:23:12Z","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.1\n"},{"id":"213948","messageId":"1365682997-11329-18-git-send-email-felipe.contreras@gmail.com","threadId":"33476","inReplyTo":"1365682997-11329-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 17/21] remote-hg: add 'insecure' option","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-11T12:23:13Z","receivedAt":"2013-04-11T12:23:13Z","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 3ae3598..3eb07dc 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.1\n"},{"id":"213949","messageId":"1365682997-11329-19-git-send-email-felipe.contreras@gmail.com","threadId":"33476","inReplyTo":"1365682997-11329-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 18/21] remote-hg: fix bad state issue","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-11T12:23:14Z","receivedAt":"2013-04-11T12:23:14Z","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 3eb07dc..e3d7f77 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.1\n"},{"id":"213950","messageId":"1365682997-11329-20-git-send-email-felipe.contreras@gmail.com","threadId":"33476","inReplyTo":"1365682997-11329-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 19/21] remote-hg: document location of stored hg repository","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-11T12:23:15Z","receivedAt":"2013-04-11T12:23:15Z","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 e3d7f77..0db4cca 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.1\n"},{"id":"213951","messageId":"1365682997-11329-21-git-send-email-felipe.contreras@gmail.com","threadId":"33476","inReplyTo":"1365682997-11329-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 20/21] remote-hg: fix bad file paths","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-11T12:23:16Z","receivedAt":"2013-04-11T12:23:16Z","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 0db4cca..a5f0013 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.1\n"},{"id":"213952","messageId":"1365682997-11329-22-git-send-email-felipe.contreras@gmail.com","threadId":"33476","inReplyTo":"1365682997-11329-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 21/21] remote-hg: activate graphlog extension for hg_log()","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-11T12:23:17Z","receivedAt":"2013-04-11T12:23:17Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"From: Antoine Pelisse <apelisse@gmail.com>\n\nThe hg_log() test helper uses the \"--graph\" parameter that is\nimplemented by the GraphLog extension. If the extension is not activated\nby the user, the parameter is not available. Activate the extension in\nsetup().\n\nAlso changes the way we grep the output in hg_log(). The pipe operator\ncan hide the return code of hg command. As a matter of fact, if log\nfails because it doesn't know about \"--graph\", it doesn't report any\nfailure and let's you think everything worked.\n\nSigned-off-by: Antoine Pelisse <apelisse@gmail.com>\nSigned-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 | 4 +++-\n 2 files changed, 7 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/remote-helpers/test-hg-bidi.sh b/contrib/remote-helpers/test-hg-bidi.sh\nindex a3c88f6..f368953 100755\n--- a/contrib/remote-helpers/test-hg-bidi.sh\n+++ b/contrib/remote-helpers/test-hg-bidi.sh\n@@ -50,7 +50,8 @@ hg_push () {\n }\n \n hg_log () {\n-\thg -R $1 log --graph --debug | grep -v 'tag: *default/'\n+\thg -R $1 log --graph --debug >log &&\n+\tgrep -v 'tag: *default/' log\n }\n \n setup () {\n@@ -62,6 +63,8 @@ setup () {\n \techo \"commit = -d \\\"0 0\\\"\"\n \techo \"debugrawcommit = -d \\\"0 0\\\"\"\n \techo \"tag = -d \\\"0 0\\\"\"\n+\techo \"[extensions]\"\n+\techo \"graphlog =\"\n \t) >> \"$HOME\"/.hgrc &&\n \tgit config --global remote-hg.hg-git-compat true\n \ndiff --git a/contrib/remote-helpers/test-hg-hg-git.sh b/contrib/remote-helpers/test-hg-hg-git.sh\nindex 73ae18d..253e65a 100755\n--- a/contrib/remote-helpers/test-hg-hg-git.sh\n+++ b/contrib/remote-helpers/test-hg-hg-git.sh\n@@ -78,7 +78,8 @@ hg_push_hg () {\n }\n \n hg_log () {\n-\thg -R $1 log --graph --debug | grep -v 'tag: *default/'\n+\thg -R $1 log --graph --debug >log &&\n+\tgrep -v 'tag: *default/' log\n }\n \n git_log () {\n@@ -97,6 +98,7 @@ setup () {\n \techo \"[extensions]\"\n \techo \"hgext.bookmarks =\"\n \techo \"hggit =\"\n+\techo \"graphlog =\"\n \t) >> \"$HOME\"/.hgrc &&\n \tgit config --global receive.denycurrentbranch warn\n \tgit config --global remote-hg.hg-git-compat true\n-- \n1.8.2.1\n"},{"id":"213979","messageId":"7vwqs9hs7m.fsf@alter.siamese.dyndns.org","threadId":"33476","inReplyTo":"1365682997-11329-1-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH v4 00/21] remote-hg: general updates","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-04-11T17:50:37Z","receivedAt":"2013-04-11T17:50:37Z","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> This is a reroll of the previous series due to a few minor issues. As the\n> previous version, forced pushes remain a configuration option. Also, I picked\n> up a fix for test regarding hg_log() that was sent to the mailing list.\n\nWill replace the previous round with this one.\n\nThe changes since the previous round looks like this on my end,\nwhich all look sensible.\n\nThanks.\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex d45f16d..a5f0013 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -655,7 +655,7 @@ def parse_commit(parser):\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+        extra['branch'] = ref[len('refs/heads/branches/'):]\n \n     if mode == 'hg':\n         i = data.find('\\n--HG--\\n')\n@@ -762,7 +762,7 @@ def do_export(parser):\n \n     # handle bookmarks\n     for bmark, node in p_bmarks:\n-        ref = 'refs/heads' + bmark\n+        ref = 'refs/heads/' + bmark\n         new = hghex(node)\n \n         if bmark in bmarks:\ndiff --git a/contrib/remote-helpers/test-hg-bidi.sh b/contrib/remote-helpers/test-hg-bidi.sh\nindex a3c88f6..f368953 100755\n--- a/contrib/remote-helpers/test-hg-bidi.sh\n+++ b/contrib/remote-helpers/test-hg-bidi.sh\n@@ -50,7 +50,8 @@ hg_push () {\n }\n \n hg_log () {\n-\thg -R $1 log --graph --debug | grep -v 'tag: *default/'\n+\thg -R $1 log --graph --debug >log &&\n+\tgrep -v 'tag: *default/' log\n }\n \n setup () {\n@@ -62,6 +63,8 @@ setup () {\n \techo \"commit = -d \\\"0 0\\\"\"\n \techo \"debugrawcommit = -d \\\"0 0\\\"\"\n \techo \"tag = -d \\\"0 0\\\"\"\n+\techo \"[extensions]\"\n+\techo \"graphlog =\"\n \t) >> \"$HOME\"/.hgrc &&\n \tgit config --global remote-hg.hg-git-compat true\n \ndiff --git a/contrib/remote-helpers/test-hg-hg-git.sh b/contrib/remote-helpers/test-hg-hg-git.sh\nindex 8c59d8e..5daad6b 100755\n--- a/contrib/remote-helpers/test-hg-hg-git.sh\n+++ b/contrib/remote-helpers/test-hg-hg-git.sh\n@@ -78,7 +78,8 @@ hg_push_hg () {\n }\n \n hg_log () {\n-\thg -R $1 log --graph --debug | grep -v 'tag: *default/'\n+\thg -R $1 log --graph --debug >log &&\n+\tgrep -v 'tag: *default/' log\n }\n \n git_log () {\n@@ -97,6 +98,7 @@ setup () {\n \techo \"[extensions]\"\n \techo \"hgext.bookmarks =\"\n \techo \"hggit =\"\n+\techo \"graphlog =\"\n \t) >> \"$HOME\"/.hgrc &&\n \tgit config --global receive.denycurrentbranch warn\n \tgit config --global remote-hg.hg-git-compat true\n"},{"id":"218618","messageId":"CALWbr2wATbq8o4kcdyAq1zt_+fbvyxUQov04xHDTXuoKYecAQw@mail.gmail.com","threadId":"33476","inReplyTo":"1365682997-11329-15-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH v4 14/21] remote-hg: show more proper errors","fromName":"Antoine Pelisse","fromEmail":"apelisse@gmail.com","sentAt":"2013-05-27T16:30:25Z","receivedAt":"2013-05-27T16:30:25Z","isPatch":true,"sender":{"key":"apelisse@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1929644?v=4"},"body":"Hey Felipe,\nI know that has been integrated a while ago.\n\nOn Thu, Apr 11, 2013 at 2:23 PM, Felipe Contreras\n<felipe.contreras@gmail.com> wrote:\n> When cloning or pushing fails, we don't want to show a stack-trace.\n>\n> diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\n> index ff89725..3ae3598 100755\n> --- a/contrib/remote-helpers/git-remote-hg\n> +++ b/contrib/remote-helpers/git-remote-hg\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\nCan you explain why \"update\" went from False to True ? That can be a\nproblem if the repository is BIG (two working directories instead of\none can raise space issues).\n\nThe commit message is not so helpful here ;)\n"},{"id":"218621","messageId":"CAMP44s0Ue5MZvRL=rbN-Ng16aPMhJxZpGgV2b=Moe8o=XgnuqA@mail.gmail.com","threadId":"33476","inReplyTo":"CALWbr2wATbq8o4kcdyAq1zt_+fbvyxUQov04xHDTXuoKYecAQw@mail.gmail.com","subject":"Re: [PATCH v4 14/21] remote-hg: show more proper errors","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-27T16:49:08Z","receivedAt":"2013-05-27T16:49:08Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Mon, May 27, 2013 at 11:30 AM, Antoine Pelisse <apelisse@gmail.com> wrote:\n> Hey Felipe,\n> I know that has been integrated a while ago.\n>\n> On Thu, Apr 11, 2013 at 2:23 PM, Felipe Contreras\n> <felipe.contreras@gmail.com> wrote:\n>> When cloning or pushing fails, we don't want to show a stack-trace.\n>>\n>> diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\n>> index ff89725..3ae3598 100755\n>> --- a/contrib/remote-helpers/git-remote-hg\n>> +++ b/contrib/remote-helpers/git-remote-hg\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>\n> Can you explain why \"update\" went from False to True ? That can be a\n> problem if the repository is BIG (two working directories instead of\n> one can raise space issues).\n>\n> The commit message is not so helpful here ;)\n\nGood catch. It was probably a mistake. However, I already sent a patch\nthat overrides this so update=False again.\n\n-- \nFelipe Contreras\n"}]}