{"thread":{"id":"33781","subject":"[PATCH v2 1/6] remote-hg: disable forced push by default","startedAt":"2013-05-10T20:59:20Z","lastAt":"2013-05-13T23:15:18Z","messageCount":8,"participants":["Felipe Contreras"],"isPatch":true,"patchVersion":2,"patchTotal":6},"messages":[{"id":"216941","messageId":"1368219566-1399-1-git-send-email-felipe.contreras@gmail.com","threadId":"33781","inReplyTo":null,"subject":"[PATCH v2 0/6] remote-hg: fixes and cleanups","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-10T20:59:20Z","receivedAt":"2013-05-10T20:59:20Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Hi,\n\nA few fixes since last series, plus a few more patches. Simple no-brainers.\n\nFelipe Contreras (6):\n  remote-hg: disable forced push by default\n  remote-hg: don't push fake 'master' bookmark\n  remote-hg: update bookmarks when pulling\n  remote-hg: test: be a little more quiet\n  remote-hg: fix new branch creation\n  remote-hg: trivial reorganization\n\n contrib/remote-helpers/git-remote-hg | 18 +++++++++++-------\n contrib/remote-helpers/test-hg.sh    |  4 ++--\n 2 files changed, 13 insertions(+), 9 deletions(-)\n\n-- \n1.8.3.rc1.579.g184e698\n"},{"id":"216940","messageId":"1368219566-1399-2-git-send-email-felipe.contreras@gmail.com","threadId":"33781","inReplyTo":"1368219566-1399-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 1/6] remote-hg: disable forced push by default","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-10T20:59:21Z","receivedAt":"2013-05-10T20:59:21Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"In certain situations we might end up pushing garbage revisions (e.g. in\na rebase), and the patches to deal with that haven't been merged yet.\n\nSo let's disable forced pushes by default.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-hg | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex 96ad30d..84901e9 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -908,7 +908,7 @@ def main(args):\n \n     hg_git_compat = False\n     track_branches = True\n-    force_push = True\n+    force_push = False\n \n     try:\n         if get_config('remote-hg.hg-git-compat') == 'true\\n':\n@@ -916,8 +916,8 @@ def main(args):\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+        if get_config('remote-hg.force-push') == 'true\\n':\n+            force_push = True\n     except subprocess.CalledProcessError:\n         pass\n \n-- \n1.8.3.rc1.579.g184e698\n"},{"id":"216943","messageId":"1368219566-1399-3-git-send-email-felipe.contreras@gmail.com","threadId":"33781","inReplyTo":"1368219566-1399-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 2/6] remote-hg: don't push fake 'master' bookmark","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-10T20:59:22Z","receivedAt":"2013-05-10T20:59:22Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"We skip it locally, but not for the remote, so let's do so.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-hg | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex 84901e9..14e7395 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -867,7 +867,8 @@ def do_export(parser):\n \n         if bmark == 'master' and 'master' not in parser.repo._bookmarks:\n             # fake bookmark\n-            pass\n+            print \"ok %s\" % ref\n+            continue\n         elif bookmarks.pushbookmark(parser.repo, bmark, old, new):\n             # updated locally\n             pass\n-- \n1.8.3.rc1.579.g184e698\n"},{"id":"216942","messageId":"1368219566-1399-4-git-send-email-felipe.contreras@gmail.com","threadId":"33781","inReplyTo":"1368219566-1399-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 3/6] remote-hg: update bookmarks when pulling","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-10T20:59:23Z","receivedAt":"2013-05-10T20:59:23Z","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 | 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 14e7395..c84a7b4 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -357,6 +357,9 @@ def get_repo(url, alias):\n                 die('Repository error')\n             repo.pull(peer, heads=None, force=True)\n \n+        rb = peer.listkeys('bookmarks')\n+        bookmarks.updatefromremote(myui, repo, rb, url)\n+\n     return repo\n \n def rev_to_mark(rev):\n-- \n1.8.3.rc1.579.g184e698\n"},{"id":"216944","messageId":"1368219566-1399-5-git-send-email-felipe.contreras@gmail.com","threadId":"33781","inReplyTo":"1368219566-1399-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 4/6] remote-hg: test: be a little more quiet","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-10T20:59:24Z","receivedAt":"2013-05-10T20:59:24Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/test-hg.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh\nindex 8de2aa7..f8d1f9e 100755\n--- a/contrib/remote-helpers/test-hg.sh\n+++ b/contrib/remote-helpers/test-hg.sh\n@@ -109,10 +109,10 @@ test_expect_success 'update bookmark' '\n   (\n   git clone \"hg::$PWD/hgrepo\" gitrepo &&\n   cd gitrepo &&\n-  git checkout devel &&\n+  git checkout --quiet devel &&\n   echo devel > content &&\n   git commit -a -m devel &&\n-  git push\n+  git push --quiet\n   ) &&\n \n   hg -R hgrepo bookmarks | egrep \"devel[\t ]+3:\"\n-- \n1.8.3.rc1.579.g184e698\n"},{"id":"216945","messageId":"1368219566-1399-6-git-send-email-felipe.contreras@gmail.com","threadId":"33781","inReplyTo":"1368219566-1399-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 5/6] remote-hg: fix new branch creation","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-10T20:59:25Z","receivedAt":"2013-05-10T20:59:25Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"When force_push is disabled, we need to turn the argument to True.\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 c84a7b4..50ead38 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -853,7 +853,7 @@ def do_export(parser):\n             continue\n \n     if peer:\n-        parser.repo.push(peer, force=force_push)\n+        parser.repo.push(peer, force=force_push, newbranch=True)\n \n     # handle bookmarks\n     for bmark, node in p_bmarks:\n-- \n1.8.3.rc1.579.g184e698\n"},{"id":"216946","messageId":"1368219566-1399-7-git-send-email-felipe.contreras@gmail.com","threadId":"33781","inReplyTo":"1368219566-1399-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v2 6/6] remote-hg: trivial reorganization","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-10T20:59:26Z","receivedAt":"2013-05-10T20:59:26Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"We only need to get the remote dict once.\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 50ead38..40da4b0 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -854,6 +854,7 @@ def do_export(parser):\n \n     if peer:\n         parser.repo.push(peer, force=force_push, newbranch=True)\n+        remote_bmarks = peer.listkeys('bookmarks')\n \n     # handle bookmarks\n     for bmark, node in p_bmarks:\n@@ -880,8 +881,7 @@ def do_export(parser):\n             continue\n \n         if peer:\n-            rb = peer.listkeys('bookmarks')\n-            old = rb.get(bmark, '')\n+            old = remote_bmarks.get(bmark, '')\n             if not peer.pushkey('bookmarks', bmark, old, new):\n                 print \"error %s\" % ref\n                 continue\n-- \n1.8.3.rc1.579.g184e698\n"},{"id":"217257","messageId":"CAMP44s0ArwaQ7GmwnP8r5DyqxDShJDkSJnUYQsGSzU589o2Quw@mail.gmail.com","threadId":"33781","inReplyTo":"1368219566-1399-1-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH v2 0/6] remote-hg: fixes and cleanups","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-13T23:15:18Z","receivedAt":"2013-05-13T23:15:18Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Fri, May 10, 2013 at 3:59 PM, Felipe Contreras\n<felipe.contreras@gmail.com> wrote:\n\n> A few fixes since last series, plus a few more patches. Simple no-brainers.\n>\n> Felipe Contreras (6):\n>   remote-hg: disable forced push by default\n>   remote-hg: don't push fake 'master' bookmark\n>   remote-hg: update bookmarks when pulling\n>   remote-hg: test: be a little more quiet\n>   remote-hg: fix new branch creation\n>   remote-hg: trivial reorganization\n>\n>  contrib/remote-helpers/git-remote-hg | 18 +++++++++++-------\n>  contrib/remote-helpers/test-hg.sh    |  4 ++--\n>  2 files changed, 13 insertions(+), 9 deletions(-)\n\nI was expecting these to be merged to 'master', but since they are\nstill not merged, I decided to send more cleanups.\n\n-- \nFelipe Contreras\n"}]}