{"thread":{"id":"33382","subject":"[PATCH v2 00/13] remote-hg: general updates","startedAt":"2013-04-04T15:30:09Z","lastAt":"2013-04-05T12:16:17Z","messageCount":30,"participants":["Felipe Contreras","Junio C Hamano","Jed Brown","Joachim Schmitz"],"isPatch":true,"patchVersion":2,"patchTotal":13},"messages":[{"id":"213100","messageId":"1365089422-8250-1-git-send-email-felipe.contreras@gmail.com","threadId":"33382","inReplyTo":null,"subject":"[PATCH v2 00/13] remote-hg: general updates","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-04T15:30:09Z","receivedAt":"2013-04-04T15:30:09Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Hi,\n\nA reroll of the previous series, only a very small bugfix, and one updated\ncommit message.\n\nDusty Phillips (2):\n  remote-hg: add missing config variable in doc\n  remote-hg: push to the appropriate branch\n\nFelipe Contreras (10):\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: force remote push\n  remote-hg: update tags globally\n\nPeter van Zetten (1):\n  remote-hg: fix for files with spaces\n\n contrib/remote-helpers/git-remote-hg     | 75 ++++++++++++++++++++++++--------\n contrib/remote-helpers/test-hg-bidi.sh   |  6 +--\n contrib/remote-helpers/test-hg-hg-git.sh |  4 +-\n 3 files changed, 63 insertions(+), 22 deletions(-)\n\n-- \n1.8.2\n"},{"id":"213101","messageId":"1365089422-8250-2-git-send-email-felipe.contreras@gmail.com","threadId":"33382","inReplyTo":"1365089422-8250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 01/13] remote-hg: trivial cleanups","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-04T15:30:10Z","receivedAt":"2013-04-04T15:30:10Z","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":"213102","messageId":"1365089422-8250-3-git-send-email-felipe.contreras@gmail.com","threadId":"33382","inReplyTo":"1365089422-8250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 02/13] remote-hg: add missing config variable in doc","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-04T15:30:11Z","receivedAt":"2013-04-04T15:30:11Z","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":"213103","messageId":"1365089422-8250-4-git-send-email-felipe.contreras@gmail.com","threadId":"33382","inReplyTo":"1365089422-8250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 03/13] remote-hg: properly report errors on bookmark pushes","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-04T15:30:12Z","receivedAt":"2013-04-04T15:30: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/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":"213105","messageId":"1365089422-8250-5-git-send-email-felipe.contreras@gmail.com","threadId":"33382","inReplyTo":"1365089422-8250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 04/13] remote-hg: fix for files with spaces","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-04T15:30:13Z","receivedAt":"2013-04-04T15:30:13Z","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":"213104","messageId":"1365089422-8250-6-git-send-email-felipe.contreras@gmail.com","threadId":"33382","inReplyTo":"1365089422-8250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 05/13] remote-hg: make sure fake bookmarks are updated","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-04T15:30:14Z","receivedAt":"2013-04-04T15:30:14Z","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":"213107","messageId":"1365089422-8250-7-git-send-email-felipe.contreras@gmail.com","threadId":"33382","inReplyTo":"1365089422-8250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 06/13] remote-hg: trivial test cleanups","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-04T15:30:15Z","receivedAt":"2013-04-04T15:30: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/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":"213106","messageId":"1365089422-8250-8-git-send-email-felipe.contreras@gmail.com","threadId":"33382","inReplyTo":"1365089422-8250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 07/13] remote-hg: redirect buggy mercurial output","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-04T15:30:16Z","receivedAt":"2013-04-04T15:30:16Z","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":"213108","messageId":"1365089422-8250-9-git-send-email-felipe.contreras@gmail.com","threadId":"33382","inReplyTo":"1365089422-8250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 08/13] remote-hg: split bookmark handling","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-04T15:30:17Z","receivedAt":"2013-04-04T15:30:17Z","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":"213109","messageId":"1365089422-8250-10-git-send-email-felipe.contreras@gmail.com","threadId":"33382","inReplyTo":"1365089422-8250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 09/13] remote-hg: refactor export","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-04T15:30:18Z","receivedAt":"2013-04-04T15:30:18Z","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":"213111","messageId":"1365089422-8250-11-git-send-email-felipe.contreras@gmail.com","threadId":"33382","inReplyTo":"1365089422-8250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 10/13] remote-hg: update remote bookmarks","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-04T15:30:19Z","receivedAt":"2013-04-04T15:30: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 | 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":"213110","messageId":"1365089422-8250-12-git-send-email-felipe.contreras@gmail.com","threadId":"33382","inReplyTo":"1365089422-8250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 11/13] remote-hg: force remote push","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-04T15:30:20Z","receivedAt":"2013-04-04T15:30:20Z","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\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-hg | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex b54de1e..b784c54 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -722,7 +722,7 @@ def do_export(parser):\n             continue\n \n     if peer:\n-        parser.repo.push(peer, force=False)\n+        parser.repo.push(peer, force=True)\n \n     # handle bookmarks\n     for bmark, node in p_bmarks:\n-- \n1.8.2\n"},{"id":"213113","messageId":"1365089422-8250-13-git-send-email-felipe.contreras@gmail.com","threadId":"33382","inReplyTo":"1365089422-8250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 12/13] remote-hg: update tags globally","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-04T15:30:21Z","receivedAt":"2013-04-04T15:30:21Z","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 b784c54..56b3641 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":"213112","messageId":"1365089422-8250-14-git-send-email-felipe.contreras@gmail.com","threadId":"33382","inReplyTo":"1365089422-8250-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 13/13] remote-hg: push to the appropriate branch","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-04T15:30:22Z","receivedAt":"2013-04-04T15:30:22Z","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 56b3641..d82eb2d 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.rpartition('/')[2]\n+\n     if mode == 'hg':\n         i = data.find('\\n--HG--\\n')\n         if i >= 0:\n-- \n1.8.2\n"},{"id":"213128","messageId":"7vmwtejlke.fsf@alter.siamese.dyndns.org","threadId":"33382","inReplyTo":"1365089422-8250-8-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH v2 07/13] remote-hg: redirect buggy mercurial output","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-04-04T16:40:49Z","receivedAt":"2013-04-04T16:40:49Z","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> Mercurial emits messages like \"searching for changes\", \"no changes\n> found\", etc. meant for the use of its own UI layer, which break the pipe\n> between transport helper and remote helper.\n>\n> Since there's no way to silence Mercurial, let's redirect to standard\n> error.\n>\n> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> ---\n\nThanks.\n\nLet me suggest retitling it with s/buggy/unwanted/, because it is\nnot a \"bug\" to have these output from Hg's point of view.  It is\njust that this reading process does not want it.\n\n>  contrib/remote-helpers/git-remote-hg | 1 +\n>  1 file changed, 1 insertion(+)\n>\n> diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\n> index 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"},{"id":"213129","messageId":"7vip42jldt.fsf@alter.siamese.dyndns.org","threadId":"33382","inReplyTo":"1365089422-8250-12-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH v2 11/13] remote-hg: force remote push","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-04-04T16:44:46Z","receivedAt":"2013-04-04T16:44:46Z","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> Ideally we shouldn't do this, as it's not recommended in mercurial\n> documentation, but there's no other way to push multiple bookmarks (on\n> the same branch), which would be the behavior most similar to git.\n>\n> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> ---\n\nIn the previous round you wanted me to exclude this one to force\nsplit head at the remote, and I saw you and Max Horn discussing\n(rather, shouting at each other ;-) why it is needed/desirable.\n\nHave you changed your mind and you want this as part of the series,\nor is it just you forgot to exclude it?\n\n>  contrib/remote-helpers/git-remote-hg | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\n> index b54de1e..b784c54 100755\n> --- a/contrib/remote-helpers/git-remote-hg\n> +++ b/contrib/remote-helpers/git-remote-hg\n> @@ -722,7 +722,7 @@ def do_export(parser):\n>              continue\n>  \n>      if peer:\n> -        parser.repo.push(peer, force=False)\n> +        parser.repo.push(peer, force=True)\n>  \n>      # handle bookmarks\n>      for bmark, node in p_bmarks:\n"},{"id":"213131","messageId":"7veheqjl4n.fsf@alter.siamese.dyndns.org","threadId":"33382","inReplyTo":"1365089422-8250-14-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH v2 13/13] remote-hg: push to the appropriate branch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-04-04T16:50:16Z","receivedAt":"2013-04-04T16:50:16Z","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> From: Dusty Phillips <dusty@linux.ca>\n>\n> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> ---\n>  contrib/remote-helpers/git-remote-hg | 4 ++++\n>  1 file changed, 4 insertions(+)\n>\n> diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\n> index 56b3641..d82eb2d 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.rpartition('/')[2]\n> +\n\nIs this meant to cut everything after \"refs/heads/branches/\", or cut\nat the last slash?  I know rpartition does the latter, but I was\nwondering if we see \"refs/heads/branches/foo/bar\" as its input here.\n\n>      if mode == 'hg':\n>          i = data.find('\\n--HG--\\n')\n>          if i >= 0:\n"},{"id":"213142","messageId":"87y5cyqhya.fsf@59A2.org","threadId":"33382","inReplyTo":"1365089422-8250-12-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH v2 11/13] remote-hg: force remote push","fromName":"Jed Brown","fromEmail":"jed@59a2.org","sentAt":"2013-04-04T18:17:01Z","receivedAt":"2013-04-04T18:17:01Z","isPatch":true,"sender":{"key":"jed@59a2.org","avatar":"https://gravatar.com/avatar/1391d04d82555f9058a9fdf5eead233e909a48e40480db31fc554e7afeb301da?d=mp&s=160"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n> Ideally we shouldn't do this, as it's not recommended in mercurial\n> documentation, but there's no other way to push multiple bookmarks (on\n> the same branch), which would be the behavior most similar to git.\n\nThe problem is that you're interacting with a Mercurial upstream, not a\nGit upstream.  When you're in their playground, you have to play by\ntheir rules.  Creating new heads is disruptive and not likely to be\nappreciated.\n"},{"id":"213160","messageId":"CAMP44s22KDoWVApwnVcGBH=EVDV+wnCQUAdEp=SRLQeb9E0J=g@mail.gmail.com","threadId":"33382","inReplyTo":"7vip42jldt.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v2 11/13] remote-hg: force remote push","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-04T18:56:39Z","receivedAt":"2013-04-04T18:56:39Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Thu, Apr 4, 2013 at 10:44 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n>> Ideally we shouldn't do this, as it's not recommended in mercurial\n>> documentation, but there's no other way to push multiple bookmarks (on\n>> the same branch), which would be the behavior most similar to git.\n>>\n>> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n>> ---\n>\n> In the previous round you wanted me to exclude this one to force\n> split head at the remote, and I saw you and Max Horn discussing\n> (rather, shouting at each other ;-) why it is needed/desirable.\n\nNo, that was \"don't update bookmarks unnecessarily\", and it seems you\nskipped it appropriately.\n\n> Have you changed your mind and you want this as part of the series,\n> or is it just you forgot to exclude it?\n\nNope, I still see no reason not to push this.\n\n-- \nFelipe Contreras\n"},{"id":"213168","messageId":"7veheqi09a.fsf@alter.siamese.dyndns.org","threadId":"33382","inReplyTo":"CAMP44s22KDoWVApwnVcGBH=EVDV+wnCQUAdEp=SRLQeb9E0J=g@mail.gmail.com","subject":"Re: [PATCH v2 11/13] remote-hg: force remote push","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-04-04T19:06:25Z","receivedAt":"2013-04-04T19:06:25Z","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 Thu, Apr 4, 2013 at 10:44 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>>\n>>> Ideally we shouldn't do this, as it's not recommended in mercurial\n>>> documentation, but there's no other way to push multiple bookmarks (on\n>>> the same branch), which would be the behavior most similar to git.\n>>>\n>>> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n>>> ---\n>>\n>> In the previous round you wanted me to exclude this one to force\n>> split head at the remote, and I saw you and Max Horn discussing\n>> (rather, shouting at each other ;-) why it is needed/desirable.\n>\n> No, that was \"don't update bookmarks unnecessarily\", and it seems you\n> skipped it appropriately.\n\nOK.\n"},{"id":"213169","messageId":"CAMP44s1b_SWkVXe2Vyzs2yj1M9Z-2KcCXbp9LCJ_oWxuC+2pAg@mail.gmail.com","threadId":"33382","inReplyTo":"87y5cyqhya.fsf@59A2.org","subject":"Re: [PATCH v2 11/13] remote-hg: force remote push","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-04T19:13:10Z","receivedAt":"2013-04-04T19:13:10Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Thu, Apr 4, 2013 at 12:17 PM, Jed Brown <jed@59a2.org> wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>> Ideally we shouldn't do this, as it's not recommended in mercurial\n>> documentation, but there's no other way to push multiple bookmarks (on\n>> the same branch), which would be the behavior most similar to git.\n>\n> The problem is that you're interacting with a Mercurial upstream, not a\n> Git upstream.  When you're in their playground, you have to play by\n> their rules.  Creating new heads is disruptive and not likely to be\n> appreciated.\n\nIf that's the case, they should disable in the server, just like some\npeople disable non-fast-forward pushes in git.\n\nThe problem is Mercurial, purely and simple, without forcing the push,\nhow do you expect this to work?\n\n% git clone hg::whatever\n% git checkout -b feature-a master\n# do stuff\n% git push -u origin feature-a\n\nIf somebody made a single commit to master (default), you can't push\nany more, you have to merge master to feature-a, and if you push\nfurther changes to feature-a and somebody is blocked by that, they\nneed to merge feature-a to master. It's a completely nonsensical\nworkflow, and there's nothing _we_ can do about it.\n\nHowever, it's easy to work around; simply create a 'bookmarks' branch\nwere people can push unlimited amounts of heads, problem solved. The\npeople working with traditional permanent branches won't be blocked by\nother people pushing bookmarks in a git-like workflow.\n\nWhy punish the sane people?\n\nHowever we can have a configuration to turn this on and off, I would\nall it remote-hg.stop-me-from-doing-what-i-just-told-you-to-do. I\ndon't see the hurry though, specially if (according to you), remote-hg\ncan't even clone.\n\nCheers.\n\n-- \nFelipe Contreras\n"},{"id":"213183","messageId":"87ppyaqcie.fsf@59A2.org","threadId":"33382","inReplyTo":"CAMP44s1b_SWkVXe2Vyzs2yj1M9Z-2KcCXbp9LCJ_oWxuC+2pAg@mail.gmail.com","subject":"Re: [PATCH v2 11/13] remote-hg: force remote push","fromName":"Jed Brown","fromEmail":"jed@59a2.org","sentAt":"2013-04-04T20:14:33Z","receivedAt":"2013-04-04T20:14:33Z","isPatch":true,"sender":{"key":"jed@59a2.org","avatar":"https://gravatar.com/avatar/1391d04d82555f9058a9fdf5eead233e909a48e40480db31fc554e7afeb301da?d=mp&s=160"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> If that's the case, they should disable in the server, just like some\n> people disable non-fast-forward pushes in git.\n\nI don't know how to make Hg allow new branches and bookmarks, but not\nnew anonymous heads.  Vanishly few Hg projects use a workflow anything\nlike topic branches so it's normally not a common thing to be creating\nnew heads.  If someone is using remote-hg, we can be pretty sure they\nare not the primary maintainer, so if they are pushing, they'll be aware\nof upstream policy and will need to play by those rules.\n\n> The problem is Mercurial, purely and simple, without forcing the push,\n> how do you expect this to work?\n>\n> % git clone hg::whatever\n> % git checkout -b feature-a master\n> # do stuff\n> % git push -u origin feature-a\n\nThere is a difference between pushing a new branch (see 'hg push\n--new-branch -b branch-name') and creating arbitrary new heads.  In a\nvery common case where multiple people are pushing to the same\nbranch/bookmark, force push creates new anonymous heads that share the\nsame branch.  (For less familiar readers, hg branches can have multiple\nheads, though most commands will behave as though the latest head to\nappear in the repository is the unique head associated with a given\nbranch.  Yes, it's insane.)\n\nNormal workflow in case of new commits upstream is to 'hg pull --rebase' or\nto pull and merge (yucky for first-parent, but most Hg users are far\nfrom caring about such things).  Silently creating new anonymous heads\nis a bad default.\n\nNote: I don't know of any way to avoid the race condition when pushing\na bookmark that creates a new head since there is no 'hg push --new-bookmark'.\n"},{"id":"213190","messageId":"CAMP44s16Yt0mL8FKXMVgLBXw7s9_S8hGyS0YNHX7GrsAXYNDfg@mail.gmail.com","threadId":"33382","inReplyTo":"87ppyaqcie.fsf@59A2.org","subject":"Re: [PATCH v2 11/13] remote-hg: force remote push","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-04T20:35:18Z","receivedAt":"2013-04-04T20:35:18Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Thu, Apr 4, 2013 at 2:14 PM, Jed Brown <jed@59a2.org> wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n>> If that's the case, they should disable in the server, just like some\n>> people disable non-fast-forward pushes in git.\n>\n> I don't know how to make Hg allow new branches and bookmarks, but not\n> new anonymous heads.\n\nIt's not possible to push new bookmarks without pushing new heads\n(unless they are all reusing the same commits), and all the drawbacks\nof doing that, Merucrial's UI make sure of that.\n\n> Vanishly few Hg projects use a workflow anything\n> like topic branches so it's normally not a common thing to be creating\n> new heads.  If someone is using remote-hg, we can be pretty sure they\n> are not the primary maintainer, so if they are pushing, they'll be aware\n> of upstream policy and\n\n> will need to play by those rules.\n\nNo, we don't. The fact that you say so doesn't make it so.\n\nI create a branch felipec-bookmarks, and I push as many heads as I\nwish. Who will get affected? Nobody. I already explained that, and you\nconveniently avoided that paragraph in the reply.\n\n>> The problem is Mercurial, purely and simple, without forcing the push,\n>> how do you expect this to work?\n>>\n>> % git clone hg::whatever\n>> % git checkout -b feature-a master\n>> # do stuff\n>> % git push -u origin feature-a\n>\n> There is a difference between pushing a new branch (see 'hg push\n> --new-branch -b branch-name') and creating arbitrary new heads.\n\nfeature-a is not a branch, it's a bookmark, and bookmarks cannot be\npushed without creating new heads (essentially).\n\n> Normal workflow in case of new commits upstream\n\nAnd who says we are committing upstream?\n\n> Note: I don't know of any way to avoid the race condition when pushing\n> a bookmark that creates a new head since there is no 'hg push --new-bookmark'.\n\nThis is not about the race condition, and the race condition cannot be\nfixed with the current design.\n\n-- \nFelipe Contreras\n"},{"id":"213194","messageId":"87li8yqayf.fsf@59A2.org","threadId":"33382","inReplyTo":"CAMP44s16Yt0mL8FKXMVgLBXw7s9_S8hGyS0YNHX7GrsAXYNDfg@mail.gmail.com","subject":"Re: [PATCH v2 11/13] remote-hg: force remote push","fromName":"Jed Brown","fromEmail":"jed@59a2.org","sentAt":"2013-04-04T20:48:08Z","receivedAt":"2013-04-04T20:48:08Z","isPatch":true,"sender":{"key":"jed@59a2.org","avatar":"https://gravatar.com/avatar/1391d04d82555f9058a9fdf5eead233e909a48e40480db31fc554e7afeb301da?d=mp&s=160"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n\n[...]\n\n>> will need to play by those rules.\n>\n> No, we don't. The fact that you say so doesn't make it so.\n\nThen perhaps we have different goals [1].  I don't know any Git User that\nwould prefer to have an Hg upstream accessed through remote-hg.  We have\nto assume that every Git (remote-hg) User is dealing with Hg Team that\nis setting the rules, since otherwise Git User would just change the\nwhole damn project to Git and be done with it.  In that sense, it is\ninappropriate to do things that are likely to make Hg Team yell at Git\nUser.\n\n> I create a branch felipec-bookmarks, and I push as many heads as I\n> wish. Who will get affected? Nobody.\n\nEvery Hg user will see those heads by default every time they run 'hg\nlog' or 'hg heads'.\n\n> And who says we are committing upstream?\n\nThe discussion is moot if you don't want to push your commits upstream.\n\n\n[1] As I mentioned earlier, I don't need either tool any more.\n"},{"id":"213206","messageId":"CAMP44s16NcTBLWuUR9bb6KaspJYYcfsWVyF9NVO4gxP-gXr4WA@mail.gmail.com","threadId":"33382","inReplyTo":"87li8yqayf.fsf@59A2.org","subject":"Re: [PATCH v2 11/13] remote-hg: force remote push","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-04T21:34:40Z","receivedAt":"2013-04-04T21:34:40Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Thu, Apr 4, 2013 at 2:48 PM, Jed Brown <jed@59a2.org> wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n>\n> [...]\n>\n>>> will need to play by those rules.\n>>\n>> No, we don't. The fact that you say so doesn't make it so.\n>\n> Then perhaps we have different goals [1].  I don't know any Git User that\n> would prefer to have an Hg upstream accessed through remote-hg.\n\nWho cares? If you don't know somebody, does that mean such person doesn't exist?\n\n> We have\n> to assume that every Git (remote-hg) User is dealing with Hg Team\n\nNo, we don't.\n\n> that\n> is setting the rules, since otherwise Git User would just change the\n> whole damn project to Git and be done with it.  In that sense, it is\n> inappropriate to do things that are likely to make Hg Team yell at Git\n> User.\n\nIf you are always going to do Mercurial workflows, then what's the\npoint of using Git?\n\n>> I create a branch felipec-bookmarks, and I push as many heads as I\n>> wish. Who will get affected? Nobody.\n>\n> Every Hg user will see those heads by default every time they run 'hg\n> log' or 'hg heads'.\n\nWow, catastrophic. BTW. Any commit pushed will show in 'hg log' either\nway. And who will run 'hg heads' if, according to you, the project has\nstated that new heads should not be pushed? If no new heads are\npushed, 'hg heads' will never show anything interesting.\n\nIs that the *HUGE* problem? Too many heads will show in the arcane 'hg heads'?\n\n>> And who says we are committing upstream?\n>\n> The discussion is moot if you don't want to push your commits upstream.\n\nThere are so many workflows and use cases you are completely ignoring.\n\nAnyway, I'm not going to discuss with you any more, a configuration\noption would work perfectly, and curiously you didn't comment on that.\nIt's quite clear that you are arguing for the sake of arguing, or at\nleast not looking for a solution.\n\nBye.\n\n-- \nFelipe Contreras\n"},{"id":"213214","messageId":"87eheqq6dk.fsf@59A2.org","threadId":"33382","inReplyTo":"CAMP44s16NcTBLWuUR9bb6KaspJYYcfsWVyF9NVO4gxP-gXr4WA@mail.gmail.com","subject":"Re: [PATCH v2 11/13] remote-hg: force remote push","fromName":"Jed Brown","fromEmail":"jed@59a2.org","sentAt":"2013-04-04T22:27:03Z","receivedAt":"2013-04-04T22:27:03Z","isPatch":true,"sender":{"key":"jed@59a2.org","avatar":"https://gravatar.com/avatar/1391d04d82555f9058a9fdf5eead233e909a48e40480db31fc554e7afeb301da?d=mp&s=160"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> On Thu, Apr 4, 2013 at 2:48 PM, Jed Brown <jed@59a2.org> wrote:\n>>\n>> Then perhaps we have different goals [1].  I don't know any Git User that\n>> would prefer to have an Hg upstream accessed through remote-hg.\n>\n> Who cares? If you don't know somebody, does that mean such person\n> doesn't exist?\n\nMaybe I wasn't explicit enough:\n\n    I don't know any Git User that would prefer to have an Hg upstream\n    accessed through remote-hg *than to have a Git upstream accessed\n    through native Git.*\n\n>> We have\n>> to assume that every Git (remote-hg) User is dealing with Hg Team\n>\n> No, we don't.\n\nReally?  If there is no Hg Team, why bother with an Hg upstream?\n\n> If you are always going to do Mercurial workflows, then what's the\n> point of using Git?\n\nUsing Git workflow locally while being able to interact with the Hg Team\nvia whatever conventions they have established.  Sane branching, merge\nstrategies, rerere, and a host of other Git features are plenty useful,\neven when contained within your personal repo.\n\n> Wow, catastrophic. BTW. Any commit pushed will show in 'hg log' either\n> way. And who will run 'hg heads' if, according to you, the project has\n> stated that new heads should not be pushed? If no new heads are\n> pushed, 'hg heads' will never show anything interesting.\n>\n> Is that the *HUGE* problem? Too many heads will show in the arcane 'hg\n> heads'?\n\nHg displays warnings about multiple heads, suggests that you merge them\nany time they are anonymous, and doesn't have remote namespaces so that\nnames can collide.  Remember that the most common reason people give for\nusing Hg in the first place is that it's \"simpler\" (yeah, I don't agree\neither, but that's their story).  So don the hat of a Git (remote-hg)\nUser: You're interacting with people that don't understand version\ncontrol very well and only know the basic Hg command set.  Do you really\nthink it's okay to silently put them in a state where Hg will print\nconfusing messages about multiple heads, disrupt their workflow ('hg\nlog'), and suggest that they do things that are likely to be disruptive\n(like merge those heads)?\n\nI've spent the last five years as an active contributor to an Hg-based\nproject and throughout that time, newer contributors would constantly\nget flustered over things like this and I would get the emails asking\nwhat happened and how to fix it.  Over that five year period, several\nother Hg projects that I was involved in switched to Git.  My statements\nabout what is likely to be acceptable to an Hg upstream is based on my\nexperience with these projects and with a couple remaining Hg holdouts\n(scientific applications that I support through libraries).  In none of\nthose projects would a force push have been acceptable.\n\n>>> And who says we are committing upstream?\n>>\n>> The discussion is moot if you don't want to push your commits upstream.\n>\n> There are so many workflows and use cases you are completely ignoring.\n\nExamples?  I'm just summarizing the workflows that I encounter and that\nother contributors to gitifyhg encounter.  You have said yourself that\nyou don't actually use remote-hg [1], so why are you so confident that\nyou know what workflows are desirable to remote-hg users?\n\n> Anyway, I'm not going to discuss with you any more, a configuration\n> option would work perfectly, and curiously you didn't comment on that.\n\nSorry, defaults matter and project philosophy matters.  The fact that we\nare arguing about such basic things has convinced me that I can't\nrecommend remote-hg because I have no confidence that the behavior will\nbe remotely acceptable to a Git user working with an Hg Team.\n\n\n\nMy primary project switched to Git three weeks ago and there is already\nless confusion, despite having adopted a master/next/topic branch\nworkflow that only two of us were familiar with prior to the switch.\nFor this reason, I no longer have a vested interest in remote helpers so\nI don't intend to debate this issue further.\n\nBut please try to make tools for actual users rather than hypothetical\nusers, or at least don't act so incredulous when people are less than\nthrilled about using or contributing to your project.\n\n\n[1] http://article.gmane.org/gmane.comp.version-control.git/219988\n"},{"id":"213217","messageId":"CAMP44s3haEqFRYfMiHOB191_UcU4YRDbRX1J=oHVyN2PEGuV3g@mail.gmail.com","threadId":"33382","inReplyTo":"87eheqq6dk.fsf@59A2.org","subject":"Re: [PATCH v2 11/13] remote-hg: force remote push","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-04T23:06:38Z","receivedAt":"2013-04-04T23:06:38Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Thu, Apr 4, 2013 at 4:27 PM, Jed Brown <jed@59a2.org> wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n>> On Thu, Apr 4, 2013 at 2:48 PM, Jed Brown <jed@59a2.org> wrote:\n>>>\n>>> Then perhaps we have different goals [1].  I don't know any Git User that\n>>> would prefer to have an Hg upstream accessed through remote-hg.\n>>\n>> Who cares? If you don't know somebody, does that mean such person\n>> doesn't exist?\n>\n> Maybe I wasn't explicit enough:\n>\n>     I don't know any Git User that would prefer to have an Hg upstream\n>     accessed through remote-hg *than to have a Git upstream accessed\n>     through native Git.*\n\nYes, Git users prefer Git, how are such obvious statements advancing any point?\n\n>>> We have\n>>> to assume that every Git (remote-hg) User is dealing with Hg Team\n>>\n>> No, we don't.\n>\n> Really?  If there is no Hg Team, why bother with an Hg upstream?\n\nSay, I push my stuff to Bitbucket, and tell my team to pull from\nthere. Bitbucket also has support for pull requests, so I push to\nBitbucket tons of branches, and then issue pull requests through the\nweb interface.\n\nMaking assumptions about how people's workflows only segregates users.\nThere is always a way to make it work for *everybody*.\n\n>> Wow, catastrophic. BTW. Any commit pushed will show in 'hg log' either\n>> way. And who will run 'hg heads' if, according to you, the project has\n>> stated that new heads should not be pushed? If no new heads are\n>> pushed, 'hg heads' will never show anything interesting.\n>>\n>> Is that the *HUGE* problem? Too many heads will show in the arcane 'hg\n>> heads'?\n>\n> Hg displays warnings about multiple heads, suggests that you merge them\n> any time they are anonymous, and doesn't have remote namespaces so that\n> names can collide.  Remember that the most common reason people give for\n> using Hg in the first place is that it's \"simpler\" (yeah, I don't agree\n> either, but that's their story).  So don the hat of a Git (remote-hg)\n> User: You're interacting with people that don't understand version\n> control very well and only know the basic Hg command set.  Do you really\n> think it's okay to silently put them in a state where Hg will print\n> confusing messages about multiple heads, disrupt their workflow ('hg\n> log'), and suggest that they do things that are likely to be disruptive\n> (like merge those heads)?\n\nThey have to merge those heads *anyway*. The only question is who and when.\n\nAnd of course this is a total red-herring, you are not answering the\nquestion at all. Newbies don't run 'hg heads', and they don't have to,\nthere's no problem with a branch specific for bookmarks. None\nwhatsoever.\n\n>>>> And who says we are committing upstream?\n>>>\n>>> The discussion is moot if you don't want to push your commits upstream.\n>>\n>> There are so many workflows and use cases you are completely ignoring.\n>\n> Examples?  I'm just summarizing the workflows that I encounter and that\n> other contributors to gitifyhg encounter.  You have said yourself that\n> you don't actually use remote-hg [1], so why are you so confident that\n> you know what workflows are desirable to remote-hg users?\n\nBecause I've used them in the past, and because I see Bitbucket, and\nbecause I have eyes.\n\n>> Anyway, I'm not going to discuss with you any more, a configuration\n>> option would work perfectly, and curiously you didn't comment on that.\n>\n> Sorry, defaults matter and project philosophy matters.  The fact that we\n> are arguing about such basic things has convinced me that I can't\n> recommend remote-hg because I have no confidence that the behavior will\n> be remotely acceptable to a Git user working with an Hg Team.\n\nYes defaults matter, and forcing the push is the only sane default,\nthere is no other way to push bookmarks in Mercurial. Period.\n\nIf your team has a problem with it, you turn it off, problem solved.\n\nAnd ultimately it doesn't matter what I say, we are in a public\nmailing list where Junio can pick anybody's patches, even if I object.\nBut you have to prove your point, and you haven't. And be honest, you\nnot recommending remote-hg has nothing to do with the quality of it,\nor the \"philosophy\" of it, it's simply because you made a different\nchoice, and you are emotionally attached to it.\n\n> But please try to make tools for actual users rather than hypothetical\n> users, or at least don't act so incredulous when people are less than\n> thrilled about using or contributing to your project.\n\nBy people you mean you. Nobody else has complained.\n\n-- \nFelipe Contreras\n"},{"id":"213245","messageId":"kjlr4o$jil$1@ger.gmane.org","threadId":"33382","inReplyTo":"87eheqq6dk.fsf@59A2.org","subject":"Re: [PATCH v2 11/13] remote-hg: force remote push","fromName":"Joachim Schmitz","fromEmail":"jojo@schmitz-digital.de","sentAt":"2013-04-05T06:31:48Z","receivedAt":"2013-04-05T06:31:48Z","isPatch":true,"sender":{"key":"jojo@schmitz-digital.de","avatar":"https://avatars.githubusercontent.com/u/1786669?v=4"},"body":"Jed Brown wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n>> On Thu, Apr 4, 2013 at 2:48 PM, Jed Brown <jed@59a2.org> wrote:\n...\n>>> We have\n>>> to assume that every Git (remote-hg) User is dealing with Hg Team\n>>\n>> No, we don't.\n>\n> Really?  If there is no Hg Team, why bother with an Hg upstream?\n\nHuh? the counterpart of \"every user\" wpuld be \"some users\" and not \"no user\" \nor \"no HG team\", isn't it? \n"},{"id":"213263","messageId":"CAMP44s04kWSQOsfE_KWAPdNSR=5oFnTcJDF4TPfRuQ6jPEGOyw@mail.gmail.com","threadId":"33382","inReplyTo":"7veheqjl4n.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v2 13/13] remote-hg: push to the appropriate branch","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-04-05T09:16:47Z","receivedAt":"2013-04-05T09:16:47Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Thu, Apr 4, 2013 at 10:50 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n>> From: Dusty Phillips <dusty@linux.ca>\n>>\n>> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n>> ---\n>>  contrib/remote-helpers/git-remote-hg | 4 ++++\n>>  1 file changed, 4 insertions(+)\n>>\n>> diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\n>> index 56b3641..d82eb2d 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.rpartition('/')[2]\n>> +\n>\n> Is this meant to cut everything after \"refs/heads/branches/\", or cut\n> at the last slash?  I know rpartition does the latter, but I was\n> wondering if we see \"refs/heads/branches/foo/bar\" as its input here.\n\nGood catch, it should be the former.\n\n-- \nFelipe Contreras\n"},{"id":"213261","messageId":"876201qijy.fsf@59A2.org","threadId":"33382","inReplyTo":"kjlr4o$jil$1@ger.gmane.org","subject":"Re: [PATCH v2 11/13] remote-hg: force remote push","fromName":"Jed Brown","fromEmail":"jed@59a2.org","sentAt":"2013-04-05T12:16:17Z","receivedAt":"2013-04-05T12:16:17Z","isPatch":true,"sender":{"key":"jed@59a2.org","avatar":"https://gravatar.com/avatar/1391d04d82555f9058a9fdf5eead233e909a48e40480db31fc554e7afeb301da?d=mp&s=160"},"body":"Joachim Schmitz <jojo@schmitz-digital.de> writes:\n\n> Jed Brown wrote:\n>>\n>> Really?  If there is no Hg Team, why bother with an Hg upstream?\n>\n> Huh? the counterpart of \"every user\" wpuld be \"some users\" and not \"no user\" \n> or \"no HG team\", isn't it? \n\nI'm not sure what you're getting at here, but the whole premise of a\ntwo-way git-remote-X is that the users of git-remote-X have less\ninfluence in the project than the users of X have in the project.\nUsually this means that the project workflow is whatever the X users\nfind comfortable rather than whatever git-remote-X users prefer.\n\nIf you are the sole publisher to a remote repository, sending pull\nrequests to upstream, and if they are comfortable with pulling bookmarks\n(much more likely if they use a pull-request model rather than a shared\nrepo), then force-pushing by default is more reasonable.  An imperfect\nanalogy is Git's push.default=simple, which is more friendly to\nbeginners and to those sharing a remote.\n"}]}