# [PATCH 0/4] remote-hg: trivial fixes and cleanups

6 messages from 2013-05-10 to 2013-05-10. Participants: Felipe Contreras.
Thread: https://gitlist.dev/t/33768

## Felipe Contreras, 2013-05-10 10:16

Subject: [PATCH 0/4] remote-hg: trivial fixes and cleanups
Message-ID: <1368181023-10402-1-git-send-email-felipe.contreras@gmail.com>
URL: https://gitlist.dev/e/1368181023-10402-1-git-send-email-felipe.contreras%40gmail.com

```
Hi,

Simple no-brainers.

Felipe Contreras (4):
  remote-hg: don't push fake 'master' bookmark
  remote-hg: update bookmarks when pulling
  remote-hg: test: be a little more quiet
  remote-hg: fix new branch creation

 contrib/remote-helpers/git-remote-hg | 7 +++++--
 contrib/remote-helpers/test-hg.sh    | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)

-- 
1.8.3.rc1.555.gd13b5a0

```

## Felipe Contreras, 2013-05-10 10:17

Subject: [PATCH 1/4] remote-hg: don't push fake 'master' bookmark
Message-ID: <1368181023-10402-2-git-send-email-felipe.contreras@gmail.com>
URL: https://gitlist.dev/e/1368181023-10402-2-git-send-email-felipe.contreras%40gmail.com
In-Reply-To: <1368181023-10402-1-git-send-email-felipe.contreras@gmail.com>

```
We skip it locally, but not for the remote, so let's do so.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/remote-helpers/git-remote-hg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg
index 96ad30d..5647ed5 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -867,7 +867,7 @@ def do_export(parser):
 
         if bmark == 'master' and 'master' not in parser.repo._bookmarks:
             # fake bookmark
-            pass
+            continue
         elif bookmarks.pushbookmark(parser.repo, bmark, old, new):
             # updated locally
             pass
-- 
1.8.3.rc1.555.gd13b5a0

```

## Felipe Contreras, 2013-05-10 10:17

Subject: [PATCH 2/4] remote-hg: update bookmarks when pulling
Message-ID: <1368181023-10402-3-git-send-email-felipe.contreras@gmail.com>
URL: https://gitlist.dev/e/1368181023-10402-3-git-send-email-felipe.contreras%40gmail.com
In-Reply-To: <1368181023-10402-1-git-send-email-felipe.contreras@gmail.com>

```
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/remote-helpers/git-remote-hg | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg
index 5647ed5..85b9319 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -357,6 +357,9 @@ def get_repo(url, alias):
                 die('Repository error')
             repo.pull(peer, heads=None, force=True)
 
+        rb = peer.listkeys('bookmarks')
+        bookmarks.updatefromremote(myui, repo, rb, url)
+
     return repo
 
 def rev_to_mark(rev):
-- 
1.8.3.rc1.555.gd13b5a0

```

## Felipe Contreras, 2013-05-10 10:17

Subject: [PATCH 3/4] remote-hg: test: be a little more quiet
Message-ID: <1368181023-10402-4-git-send-email-felipe.contreras@gmail.com>
URL: https://gitlist.dev/e/1368181023-10402-4-git-send-email-felipe.contreras%40gmail.com
In-Reply-To: <1368181023-10402-1-git-send-email-felipe.contreras@gmail.com>

```
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/remote-helpers/test-hg.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh
index 8de2aa7..f8d1f9e 100755
--- a/contrib/remote-helpers/test-hg.sh
+++ b/contrib/remote-helpers/test-hg.sh
@@ -109,10 +109,10 @@ test_expect_success 'update bookmark' '
   (
   git clone "hg::$PWD/hgrepo" gitrepo &&
   cd gitrepo &&
-  git checkout devel &&
+  git checkout --quiet devel &&
   echo devel > content &&
   git commit -a -m devel &&
-  git push
+  git push --quiet
   ) &&
 
   hg -R hgrepo bookmarks | egrep "devel[	 ]+3:"
-- 
1.8.3.rc1.555.gd13b5a0

```

## Felipe Contreras, 2013-05-10 10:17

Subject: [PATCH 4/4] remote-hg: fix new branch creation
Message-ID: <1368181023-10402-5-git-send-email-felipe.contreras@gmail.com>
URL: https://gitlist.dev/e/1368181023-10402-5-git-send-email-felipe.contreras%40gmail.com
In-Reply-To: <1368181023-10402-1-git-send-email-felipe.contreras@gmail.com>

```
When force_push is disabled, we need to turn the argument to True.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/remote-helpers/git-remote-hg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg
index 85b9319..10f073a 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -853,7 +853,7 @@ def do_export(parser):
             continue
 
     if peer:
-        parser.repo.push(peer, force=force_push)
+        parser.repo.push(peer, force=force_push, newbranch=True)
 
     # handle bookmarks
     for bmark, node in p_bmarks:
-- 
1.8.3.rc1.555.gd13b5a0

```

## Felipe Contreras, 2013-05-10 12:20

Subject: Re: [PATCH 1/4] remote-hg: don't push fake 'master' bookmark
Message-ID: <CAMP44s2=xj=PS8Eb7D-meAO9U1x1yTD9PShJrMXP1dHMVUYXnA@mail.gmail.com>
URL: https://gitlist.dev/e/CAMP44s2%3Dxj%3DPS8Eb7D-meAO9U1x1yTD9PShJrMXP1dHMVUYXnA%40mail.gmail.com
In-Reply-To: <1368181023-10402-2-git-send-email-felipe.contreras@gmail.com>

```
On Fri, May 10, 2013 at 5:17 AM, Felipe Contreras
<felipe.contreras@gmail.com> wrote:
> --- a/contrib/remote-helpers/git-remote-hg
> +++ b/contrib/remote-helpers/git-remote-hg
> @@ -867,7 +867,7 @@ def do_export(parser):
>
>          if bmark == 'master' and 'master' not in parser.repo._bookmarks:
>              # fake bookmark
> -            pass

Missed:

+ print "ok %s" % ref

> +            continue
>          elif bookmarks.pushbookmark(parser.repo, bmark, old, new):
>              # updated locally
>              pass

-- 
Felipe Contreras

```
