{"thread":{"id":"32091","subject":"[PATCH 0/4] remote-hg: small fixes","startedAt":"2012-11-12T17:41:04Z","lastAt":"2012-11-13T07:12:21Z","messageCount":11,"participants":["Felipe Contreras","Jeff King","Ramkumar Ramachandra"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"202965","messageId":"1352742068-15346-1-git-send-email-felipe.contreras@gmail.com","threadId":"32091","inReplyTo":null,"subject":"[PATCH 0/4] remote-hg: small fixes","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-11-12T17:41:04Z","receivedAt":"2012-11-12T17:41:04Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Hi,\n\nJust a few fixes, nothing major.\n\nFelipe Contreras (3):\n  remote-hg: fix compatibility with older versions of hg\n  remote-hg: try the 'tip' if no checkout present\n  remote-hg: avoid bad refs\n\nRamkumar Ramachandra (1):\n  remote-hg: add missing config for basic tests\n\n contrib/remote-helpers/git-remote-hg | 7 ++++++-\n contrib/remote-helpers/test-hg.sh    | 9 +++++++++\n 2 files changed, 15 insertions(+), 1 deletion(-)\n\n-- \n1.8.0\n"},{"id":"202966","messageId":"1352742068-15346-2-git-send-email-felipe.contreras@gmail.com","threadId":"32091","inReplyTo":"1352742068-15346-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 1/4] remote-hg: add missing config for basic tests","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-11-12T17:41:05Z","receivedAt":"2012-11-12T17:41:05Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"From: Ramkumar Ramachandra <artagnon@gmail.com>\n\n'hg commit' fails otherwise in some versiosn of mercurial because of\nthe missing user information. Other versions simply throw a warning and\nguess though.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/test-hg.sh | 9 +++++++++\n 1 file changed, 9 insertions(+)\n\ndiff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh\nindex 40e6e3c..031dcbd 100755\n--- a/contrib/remote-helpers/test-hg.sh\n+++ b/contrib/remote-helpers/test-hg.sh\n@@ -29,6 +29,15 @@ check () {\n \ttest_cmp expected actual\n }\n \n+setup () {\n+\t(\n+\techo \"[ui]\"\n+\techo \"username = A U Thor <author@example.com>\"\n+\t) >> \"$HOME\"/.hgrc\n+}\n+\n+setup\n+\n test_expect_success 'cloning' '\n   test_when_finished \"rm -rf gitrepo*\" &&\n \n-- \n1.8.0\n"},{"id":"202967","messageId":"1352742068-15346-3-git-send-email-felipe.contreras@gmail.com","threadId":"32091","inReplyTo":"1352742068-15346-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 2/4] remote-hg: fix compatibility with older versions of hg","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-11-12T17:41:06Z","receivedAt":"2012-11-12T17:41:06Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Turns out repo.revs was introduced quite late, and it doesn't do\nanything fancy for our refspec; only list all the numbers in that range.\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 1d46838..c6d0367 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -294,7 +294,7 @@ def export_ref(repo, name, kind, head):\n     if tip and tip == head.rev():\n         # nothing to do\n         return\n-    revs = repo.revs('%u:%u' % (tip, head))\n+    revs = xrange(tip, head.rev() + 1)\n     count = 0\n \n     revs = [rev for rev in revs if not marks.is_marked(rev)]\n-- \n1.8.0\n"},{"id":"202968","messageId":"1352742068-15346-4-git-send-email-felipe.contreras@gmail.com","threadId":"32091","inReplyTo":"1352742068-15346-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 3/4] remote-hg: try the 'tip' if no checkout present","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-11-12T17:41:07Z","receivedAt":"2012-11-12T17:41:07Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"There's no concept of HEAD in mercurial, but let's try our best to do\nsomething sensible.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/remote-helpers/git-remote-hg | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex c6d0367..3cdc1e2 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -440,6 +440,8 @@ def list_head(repo, cur):\n         head = cur\n         node = repo['.']\n         if not node:\n+            node = repo['tip']\n+        if not node:\n             return\n         if head == 'default':\n             head = 'master'\n-- \n1.8.0\n"},{"id":"202969","messageId":"1352742068-15346-5-git-send-email-felipe.contreras@gmail.com","threadId":"32091","inReplyTo":"1352742068-15346-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 4/4] remote-hg: avoid bad refs","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-11-12T17:41:08Z","receivedAt":"2012-11-12T17:41:08Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Turns out fast-export throws bad 'reset' commands because of a behavior\nin transport-helper that is not even needed.\n\nEither way, better to ignore them, otherwise the user will get warnings\nwhen we OK them.\n\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 3cdc1e2..48f8f5d 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -704,6 +704,9 @@ def do_export(parser):\n         elif ref.startswith('refs/tags/'):\n             tag = ref[len('refs/tags/'):]\n             parser.repo.tag([tag], node, None, True, None, {})\n+        else:\n+            # transport-helper/fast-export bugs\n+            continue\n         print \"ok %s\" % ref\n \n     print\n-- \n1.8.0\n"},{"id":"202994","messageId":"20121112203207.GF4623@sigill.intra.peff.net","threadId":"32091","inReplyTo":"1352742068-15346-2-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH 1/4] remote-hg: add missing config for basic tests","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-11-12T20:32:07Z","receivedAt":"2012-11-12T20:32:07Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Nov 12, 2012 at 06:41:05PM +0100, Felipe Contreras wrote:\n\n> From: Ramkumar Ramachandra <artagnon@gmail.com>\n> \n> 'hg commit' fails otherwise in some versiosn of mercurial because of\n\ns/versiosn/versions/\n\n> +setup () {\n> +\t(\n> +\techo \"[ui]\"\n> +\techo \"username = A U Thor <author@example.com>\"\n> +\t) >> \"$HOME\"/.hgrc\n> +}\n\nThis makes sense, but I wonder if we should use something different from\nthe git author ident set up by the test scripts, just to double check\nthat we do not have any bugs in confusing the two during the import.\n\nSomething like \"H G Wells <wells@example.com>\" would work, and satisfies\nmy deep-seated desire for bad puns.\n\n-Peff\n"},{"id":"203040","messageId":"CAMP44s2GzX_+6+eNU5n6kGue_-MWvU9qNXAr3Caw3A7nWhkawA@mail.gmail.com","threadId":"32091","inReplyTo":"20121112203207.GF4623@sigill.intra.peff.net","subject":"Re: [PATCH 1/4] remote-hg: add missing config for basic tests","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-11-13T03:46:36Z","receivedAt":"2012-11-13T03:46:36Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Mon, Nov 12, 2012 at 9:32 PM, Jeff King <peff@peff.net> wrote:\n> On Mon, Nov 12, 2012 at 06:41:05PM +0100, Felipe Contreras wrote:\n>\n>> From: Ramkumar Ramachandra <artagnon@gmail.com>\n>>\n>> 'hg commit' fails otherwise in some versiosn of mercurial because of\n>\n> s/versiosn/versions/\n>\n>> +setup () {\n>> +     (\n>> +     echo \"[ui]\"\n>> +     echo \"username = A U Thor <author@example.com>\"\n>> +     ) >> \"$HOME\"/.hgrc\n>> +}\n>\n> This makes sense, but I wonder if we should use something different from\n> the git author ident set up by the test scripts, just to double check\n> that we do not have any bugs in confusing the two during the import.\n\nI don't know, but these tests would not check for any of those issues.\nWhen such tests are added I would prefer the author to use to be\nexplicitly defined, but lets see.\n\n-- \nFelipe Contreras\n"},{"id":"203048","messageId":"CALkWK0k9Ta-SOo43Knz9kMV0ePKf7wjK-3Zm6ocDQpe7VzFz+A@mail.gmail.com","threadId":"32091","inReplyTo":"1352742068-15346-3-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH 2/4] remote-hg: fix compatibility with older versions of hg","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2012-11-13T05:25:37Z","receivedAt":"2012-11-13T05:25:37Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"This patch fixes my original problem. So,\nReported-by: Ramkumar Ramachandra <artagnon@gmail.com>\nTested-by: Ramkumar Ramachandra <artagnon@gmail.com>\n\nHowever, test 4 in test-hg.sh still fails for me:\n\n--- expected    2012-11-13 05:22:57.946637384 +0000\n+++ actual      2012-11-13 05:22:57.946637384 +0000\n@@ -1,2 +1,2 @@\n-zero\n-refs/heads/master\n+feature-a\n+refs/heads/feature-a\n\nWhat is going on?\n\nRam\n"},{"id":"203052","messageId":"20121113054826.GC10995@sigill.intra.peff.net","threadId":"32091","inReplyTo":"CAMP44s2GzX_+6+eNU5n6kGue_-MWvU9qNXAr3Caw3A7nWhkawA@mail.gmail.com","subject":"Re: [PATCH 1/4] remote-hg: add missing config for basic tests","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-11-13T05:48:26Z","receivedAt":"2012-11-13T05:48:26Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Nov 13, 2012 at 04:46:36AM +0100, Felipe Contreras wrote:\n\n> >> +setup () {\n> >> +     (\n> >> +     echo \"[ui]\"\n> >> +     echo \"username = A U Thor <author@example.com>\"\n> >> +     ) >> \"$HOME\"/.hgrc\n> >> +}\n> >\n> > This makes sense, but I wonder if we should use something different from\n> > the git author ident set up by the test scripts, just to double check\n> > that we do not have any bugs in confusing the two during the import.\n> \n> I don't know, but these tests would not check for any of those issues.\n> When such tests are added I would prefer the author to use to be\n> explicitly defined, but lets see.\n\nIt's OK if we do not add more explicit tests at this point. I'd just\nrather set a safer precedent on the off chance that it might catch\nsomething in a later test, just as we use separate GIT_AUTHOR_* and\nGIT_COMMITTER_* in the rest of the test suite. If the choice were not\ncompletely arbitrary and had some maintenance cost, I might be more\nconcerned, but as far as I can tell, one name is as good as another at\nthis point.\n\nAny objection to me marking it up as I apply?\n\n-Peff\n"},{"id":"203055","messageId":"CAMP44s3GQOVUGOMsz=U5zbecsHybejjH-KLgmbmJsbnzFzC+qg@mail.gmail.com","threadId":"32091","inReplyTo":"CALkWK0k9Ta-SOo43Knz9kMV0ePKf7wjK-3Zm6ocDQpe7VzFz+A@mail.gmail.com","subject":"Re: [PATCH 2/4] remote-hg: fix compatibility with older versions of hg","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-11-13T07:11:05Z","receivedAt":"2012-11-13T07:11:05Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Tue, Nov 13, 2012 at 6:25 AM, Ramkumar Ramachandra\n<artagnon@gmail.com> wrote:\n> This patch fixes my original problem. So,\n> Reported-by: Ramkumar Ramachandra <artagnon@gmail.com>\n> Tested-by: Ramkumar Ramachandra <artagnon@gmail.com>\n>\n> However, test 4 in test-hg.sh still fails for me:\n>\n> --- expected    2012-11-13 05:22:57.946637384 +0000\n> +++ actual      2012-11-13 05:22:57.946637384 +0000\n> @@ -1,2 +1,2 @@\n> -zero\n> -refs/heads/master\n> +feature-a\n> +refs/heads/feature-a\n>\n> What is going on?\n\nProbably a bug in mercurial, but can be worked around:\n\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -429,10 +429,18 @@ def get_branch_tip(repo, branch):\n\n     return heads[0]\n\n+def get_current_bookmark(repo):\n+    head = bookmarks.readcurrent(repo)\n+    if not head:\n+        return None\n+    if repo[head] != repo['.']:\n+        return None\n+    return head\n+\n def list_head(repo, cur):\n     global g_head, bmarks\n\n-    head = bookmarks.readcurrent(repo)\n+    head = get_current_bookmark(repo)\n     if head:\n         node = repo[head]\n     else:\n\n-- \nFelipe Contreras\n"},{"id":"203056","messageId":"CAMP44s2AH=JmopgMsrhuKm20WAh7yP5B6vz7oew9FL-nu+c4rA@mail.gmail.com","threadId":"32091","inReplyTo":"20121113054826.GC10995@sigill.intra.peff.net","subject":"Re: [PATCH 1/4] remote-hg: add missing config for basic tests","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-11-13T07:12:21Z","receivedAt":"2012-11-13T07:12:21Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Tue, Nov 13, 2012 at 6:48 AM, Jeff King <peff@peff.net> wrote:\n\n> Any objection to me marking it up as I apply?\n\nNope.\n\n-- \nFelipe Contreras\n"}]}