diff --git a/hggit/__init__.py b/hggit/__init__.py index d2c4333e5f14ab690242ee9052fedb0e8ee2f4be_aGdnaXQvX19pbml0X18ucHk=..1189a4f3e2389ed831acd1e364a118253cf9fbaa_aGdnaXQvX19pbml0X18ucHk= 100644 --- a/hggit/__init__.py +++ b/hggit/__init__.py @@ -129,10 +129,6 @@ if getattr(discovery, 'findcommonoutgoing', None): kwname = 'onlyheads' def findoutgoing(orig, local, remote, *args, **kwargs): - kw = {} - kw.update(kwargs) - for val, k in zip(args, ('base', kwname, 'force')): - kw[k] = val if isinstance(remote, gitrepo.gitrepo): # clean up this cruft when we're 1.7-only, remoteheads and # the return value change happened between 1.6 and 1.7. @@ -136,6 +132,10 @@ if isinstance(remote, gitrepo.gitrepo): # clean up this cruft when we're 1.7-only, remoteheads and # the return value change happened between 1.6 and 1.7. + kw = {} + kw.update(kwargs) + for val, k in zip(args, ('base', kwname, 'force')): + kw[k] = val git = GitHandler(local, local.ui) base, heads = git.get_refs(remote.path) newkw = {'base': base, kwname: heads} @@ -146,7 +146,8 @@ return [x[0] for x in r] if kwname == 'onlyheads': del kw['base'] - return orig(local, remote, **kw) + return orig(local, remote, **kw) + return orig(local, remote, *args, **kwargs) if getattr(discovery, 'findoutgoing', None): extensions.wrapfunction(discovery, 'findoutgoing', findoutgoing) else: diff --git a/hggit/git_handler.py b/hggit/git_handler.py index d2c4333e5f14ab690242ee9052fedb0e8ee2f4be_aGdnaXQvZ2l0X2hhbmRsZXIucHk=..1189a4f3e2389ed831acd1e364a118253cf9fbaa_aGdnaXQvZ2l0X2hhbmRsZXIucHk= 100644 --- a/hggit/git_handler.py +++ b/hggit/git_handler.py @@ -51,9 +51,9 @@ self.lasttopic = topic pos, total = map(int, m.group(1, 2)) - self.ui.progress(topic, pos, total=total) + util.progress(self.ui, topic, pos, total=total) else: self.flush(msg) def flush(self, msg=None): if self.lasttopic: @@ -55,9 +55,9 @@ else: self.flush(msg) def flush(self, msg=None): if self.lasttopic: - self.ui.progress(self.lasttopic, None) + util.progress(self.ui, self.lasttopic, None) self.lasttopic = None if msg: self.ui.note(msg + '\n') @@ -135,6 +135,7 @@ def import_commits(self, remote_name): self.import_git_objects(remote_name) + self.update_hg_bookmarks(self.git.get_refs()) self.save_map() def fetch(self, remote, heads): @@ -200,8 +201,11 @@ changed_refs = [ref for ref, sha in new_refs.iteritems() if sha != old_refs.get(ref)] new = [bin(self.map_hg_get(new_refs[ref])) for ref in changed_refs] - old = dict( (bin(self.map_hg_get(old_refs[r])), 1) - for r in old_refs) + old = {} + for r in old_refs: + old_ref = self.map_hg_get(old_refs[r]) + if old_ref: + old[bin(old_ref)] = 1 return old, new except (HangupException, GitProtocolError), e: @@ -785,7 +789,8 @@ raise hgutil.Abort("ambiguous reference %s: %r" % (h, r)) else: want = [sha for ref, sha in refs.iteritems() - if not ref.endswith('^{}')] + if not ref.endswith('^{}') + and ( ref.startswith('refs/heads/') or ref.startswith('refs/tags/') ) ] want = [x for x in want if x not in self.git] return want f, commit = self.git.object_store.add_pack() @@ -809,7 +814,9 @@ # Create a local Git branch name for each # Mercurial bookmark. for key in heads: - self.git.refs['refs/heads/' + key] = self.map_git_get(heads[key]) + git_ref = self.map_git_get(heads[key]) + if git_ref: + self.git.refs['refs/heads/' + key] = self.map_git_get(heads[key]) def export_hg_tags(self): for tag, sha in self.repo.tags().iteritems(): @@ -1058,7 +1065,8 @@ else: hostpath_seper = '/' + port = None host, path = hostpath.split(hostpath_seper, 1) if hostpath_seper == '/': transportpath = '/' + path else: @@ -1061,8 +1069,16 @@ host, path = hostpath.split(hostpath_seper, 1) if hostpath_seper == '/': transportpath = '/' + path else: - transportpath = path - return transport(host, thin_packs=False), transportpath + # port number should be recognized + m = re.match('^(?P<port>\d+)?(?P<path>.*)$', path) + if m.group('port'): + client.port = m.group('port') + port = client.port + transportpath = m.group('path') + else: + transportpath = path + + return transport(host, thin_packs=False, port=port), transportpath # if its not git or git+ssh, try a local url.. return client.SubprocessGitClient(thin_packs=False), uri diff --git a/tests/test-conflict-1.out b/tests/test-conflict-1.out index d2c4333e5f14ab690242ee9052fedb0e8ee2f4be_dGVzdHMvdGVzdC1jb25mbGljdC0xLm91dA==..1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC1jb25mbGljdC0xLm91dA== 100644 --- a/tests/test-conflict-1.out +++ b/tests/test-conflict-1.out @@ -21,9 +21,6 @@ pushing to git://localhost/gitrepo exporting hg objects to git creating and sending data -Counting objects: 10, done. -Compressing objects: 25% (1/4) Compressing objects: 50% (2/4) Compressing objects: 75% (3/4) Compressing objects: 100% (4/4) Compressing objects: 100% (4/4), done. -Total 10 (delta 0), reused 0 (delta 0) importing git objects into hg 1 files updated, 0 files merged, 0 files removed, 0 files unresolved % expect the same revision ids as above diff --git a/tests/test-conflict-2.out b/tests/test-conflict-2.out index d2c4333e5f14ab690242ee9052fedb0e8ee2f4be_dGVzdHMvdGVzdC1jb25mbGljdC0yLm91dA==..1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC1jb25mbGljdC0yLm91dA== 100644 --- a/tests/test-conflict-2.out +++ b/tests/test-conflict-2.out @@ -21,9 +21,6 @@ pushing to git://localhost/gitrepo exporting hg objects to git creating and sending data -Counting objects: 10, done. -Compressing objects: 25% (1/4) Compressing objects: 50% (2/4) Compressing objects: 75% (3/4) Compressing objects: 100% (4/4) Compressing objects: 100% (4/4), done. -Total 10 (delta 0), reused 0 (delta 0) importing git objects into hg 1 files updated, 0 files merged, 0 files removed, 0 files unresolved % expect the same revision ids as above diff --git a/tests/test-convergedmerge.out b/tests/test-convergedmerge.out index d2c4333e5f14ab690242ee9052fedb0e8ee2f4be_dGVzdHMvdGVzdC1jb252ZXJnZWRtZXJnZS5vdXQ=..1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC1jb252ZXJnZWRtZXJnZS5vdXQ= 100644 --- a/tests/test-convergedmerge.out +++ b/tests/test-convergedmerge.out @@ -22,9 +22,6 @@ pushing to git://localhost/gitrepo exporting hg objects to git creating and sending data -Counting objects: 11, done. -Compressing objects: 20% (1/5) Compressing objects: 40% (2/5) Compressing objects: 60% (3/5) Compressing objects: 80% (4/5) Compressing objects: 100% (5/5) Compressing objects: 100% (5/5), done. -Total 11 (delta 0), reused 0 (delta 0) importing git objects into hg 1 files updated, 0 files merged, 0 files removed, 0 files unresolved % expect the same revision ids as above diff --git a/tests/test-empty-working-tree.out b/tests/test-empty-working-tree.out index d2c4333e5f14ab690242ee9052fedb0e8ee2f4be_dGVzdHMvdGVzdC1lbXB0eS13b3JraW5nLXRyZWUub3V0..1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC1lbXB0eS13b3JraW5nLXRyZWUub3V0 100644 --- a/tests/test-empty-working-tree.out +++ b/tests/test-empty-working-tree.out @@ -2,8 +2,6 @@ Initialized empty Git repository in gitrepo2/ -Counting objects: 2, done. -Total 2 (delta 0), reused 0 (delta 0) importing git objects into hg 0 files updated, 0 files merged, 0 files removed, 0 files unresolved files: diff --git a/tests/test-encoding.out b/tests/test-encoding.out index d2c4333e5f14ab690242ee9052fedb0e8ee2f4be_dGVzdHMvdGVzdC1lbmNvZGluZy5vdXQ=..1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC1lbmNvZGluZy5vdXQ= 100644 --- a/tests/test-encoding.out +++ b/tests/test-encoding.out @@ -8,9 +8,6 @@ variable i18n.commitencoding to the encoding your project uses. Initialized empty Git repository in gitrepo2/ -Counting objects: 12, done. -Compressing objects: 14% (1/7) Compressing objects: 28% (2/7) Compressing objects: 42% (3/7) Compressing objects: 57% (4/7) Compressing objects: 71% (5/7) Compressing objects: 85% (6/7) Compressing objects: 100% (7/7) Compressing objects: 100% (7/7), done. -Total 12 (delta 1), reused 0 (delta 0) importing git objects into hg 4 files updated, 0 files merged, 0 files removed, 0 files unresolved @ changeset: 3:8549ee7fe0801b2dafc06047ca6f66d36da709f5 diff --git a/tests/test-file-removal.out b/tests/test-file-removal.out index d2c4333e5f14ab690242ee9052fedb0e8ee2f4be_dGVzdHMvdGVzdC1maWxlLXJlbW92YWwub3V0..1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC1maWxlLXJlbW92YWwub3V0 100644 --- a/tests/test-file-removal.out +++ b/tests/test-file-removal.out @@ -6,9 +6,6 @@ beta Initialized empty Git repository in gitrepo2/ -Counting objects: 14, done. -Compressing objects: 12% (1/8) Compressing objects: 25% (2/8) Compressing objects: 37% (3/8) Compressing objects: 50% (4/8) Compressing objects: 62% (5/8) Compressing objects: 75% (6/8) Compressing objects: 87% (7/8) Compressing objects: 100% (8/8) Compressing objects: 100% (8/8), done. -Total 14 (delta 1), reused 0 (delta 0) importing git objects into hg 1 files updated, 0 files merged, 0 files removed, 0 files unresolved @ changeset: 4:ea41a3f0ed10 diff --git a/tests/test-git-clone.out b/tests/test-git-clone.out index d2c4333e5f14ab690242ee9052fedb0e8ee2f4be_dGVzdHMvdGVzdC1naXQtY2xvbmUub3V0..1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC1naXQtY2xvbmUub3V0 100644 --- a/tests/test-git-clone.out +++ b/tests/test-git-clone.out @@ -1,8 +1,5 @@ Initialized empty Git repository in gitrepo/.git/ -Counting objects: 6, done. -Compressing objects: 33% (1/3) Compressing objects: 66% (2/3) Compressing objects: 100% (3/3) Compressing objects: 100% (3/3), done. -Total 6 (delta 0), reused 0 (delta 0) importing git objects into hg 2 files updated, 0 files merged, 0 files removed, 0 files unresolved @ changeset: 1:7bcd915dc873 diff --git a/tests/test-git-submodules.out b/tests/test-git-submodules.out index d2c4333e5f14ab690242ee9052fedb0e8ee2f4be_dGVzdHMvdGVzdC1naXQtc3VibW9kdWxlcy5vdXQ=..1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC1naXQtc3VibW9kdWxlcy5vdXQ= 100644 --- a/tests/test-git-submodules.out +++ b/tests/test-git-submodules.out @@ -16,9 +16,6 @@ 2 files changed, 0 insertions(+), 4 deletions(-) delete mode 100644 .gitmodules delete mode 160000 subrepo -Counting objects: 7, done. -Compressing objects: 20% (1/5) Compressing objects: 40% (2/5) Compressing objects: 60% (3/5) Compressing objects: 80% (4/5) Compressing objects: 100% (5/5) Compressing objects: 100% (5/5), done. -Total 7 (delta 1), reused 0 (delta 0) importing git objects into hg 1 files updated, 0 files merged, 0 files removed, 0 files unresolved @ changeset: 2:954cdf1c8c82 diff --git a/tests/test-git-tags.out b/tests/test-git-tags.out index d2c4333e5f14ab690242ee9052fedb0e8ee2f4be_dGVzdHMvdGVzdC1naXQtdGFncy5vdXQ=..1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC1naXQtdGFncy5vdXQ= 100644 --- a/tests/test-git-tags.out +++ b/tests/test-git-tags.out @@ -1,8 +1,5 @@ Initialized empty Git repository in gitrepo/.git/ -Counting objects: 7, done. -Compressing objects: 25% (1/4) Compressing objects: 50% (2/4) Compressing objects: 75% (3/4) Compressing objects: 100% (4/4) Compressing objects: 100% (4/4), done. -Total 7 (delta 0), reused 0 (delta 0) importing git objects into hg 2 files updated, 0 files merged, 0 files removed, 0 files unresolved @ changeset: 1:99dcc15b7b07 diff --git a/tests/test-git-workflow b/tests/test-git-workflow index d2c4333e5f14ab690242ee9052fedb0e8ee2f4be_dGVzdHMvdGVzdC1naXQtd29ya2Zsb3c=..1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC1naXQtd29ya2Zsb3c= 100755 --- a/tests/test-git-workflow +++ b/tests/test-git-workflow @@ -66,4 +66,5 @@ echo % get things back to hg hg gimport hg log --graph --debug | grep -v ': *master' +echo % gimport should have updated the bookmarks as well hg bookmarks diff --git a/tests/test-git-workflow.out b/tests/test-git-workflow.out index d2c4333e5f14ab690242ee9052fedb0e8ee2f4be_dGVzdHMvdGVzdC1naXQtd29ya2Zsb3cub3V0..1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC1naXQtd29ya2Zsb3cub3V0 100644 --- a/tests/test-git-workflow.out +++ b/tests/test-git-workflow.out @@ -45,4 +45,5 @@ add alpha +% gimport should have updated the bookmarks as well master 1:7108ae7bd184 diff --git a/tests/test-hg-author.out b/tests/test-hg-author.out index d2c4333e5f14ab690242ee9052fedb0e8ee2f4be_dGVzdHMvdGVzdC1oZy1hdXRob3Iub3V0..1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC1oZy1hdXRob3Iub3V0 100644 --- a/tests/test-hg-author.out +++ b/tests/test-hg-author.out @@ -1,8 +1,6 @@ Initialized empty Git repository in gitrepo/.git/ Switched to a new branch 'not-master' -Counting objects: 3, done. -Total 3 (delta 0), reused 0 (delta 0) importing git objects into hg 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 0 files updated, 0 files merged, 0 files removed, 0 files unresolved @@ -34,9 +32,6 @@ date: Mon Jan 01 00:00:10 2007 +0000 summary: add alpha -Counting objects: 9, done. -Compressing objects: 20% (1/5) Compressing objects: 40% (2/5) Compressing objects: 60% (3/5) Compressing objects: 80% (4/5) Compressing objects: 100% (5/5) Compressing objects: 100% (5/5), done. -Total 9 (delta 0), reused 0 (delta 0) importing git objects into hg 2 files updated, 0 files merged, 0 files removed, 0 files unresolved @ changeset: 2:92d33c0dd6e1 diff --git a/tests/test-hg-branch.out b/tests/test-hg-branch.out index d2c4333e5f14ab690242ee9052fedb0e8ee2f4be_dGVzdHMvdGVzdC1oZy1icmFuY2gub3V0..1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC1oZy1icmFuY2gub3V0 100644 --- a/tests/test-hg-branch.out +++ b/tests/test-hg-branch.out @@ -1,8 +1,6 @@ Initialized empty Git repository in gitrepo/.git/ Switched to a new branch 'not-master' -Counting objects: 3, done. -Total 3 (delta 0), reused 0 (delta 0) importing git objects into hg 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 0 files updated, 0 files merged, 0 files removed, 0 files unresolved @@ -36,9 +34,6 @@ date: Mon Jan 01 00:00:10 2007 +0000 summary: add alpha -Counting objects: 6, done. -Compressing objects: 33% (1/3) Compressing objects: 66% (2/3) Compressing objects: 100% (3/3) Compressing objects: 100% (3/3), done. -Total 6 (delta 0), reused 0 (delta 0) importing git objects into hg 1 files updated, 0 files merged, 0 files removed, 0 files unresolved o changeset: 2:05aed681ccb3 diff --git a/tests/test-hg-tags.out b/tests/test-hg-tags.out index d2c4333e5f14ab690242ee9052fedb0e8ee2f4be_dGVzdHMvdGVzdC1oZy10YWdzLm91dA==..1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC1oZy10YWdzLm91dA== 100644 --- a/tests/test-hg-tags.out +++ b/tests/test-hg-tags.out @@ -1,8 +1,6 @@ Initialized empty Git repository in gitrepo/.git/ Switched to a new branch 'not-master' -Counting objects: 3, done. -Total 3 (delta 0), reused 0 (delta 0) importing git objects into hg 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 0 files updated, 0 files merged, 0 files removed, 0 files unresolved @@ -28,9 +26,6 @@ % git should have the tag alpha alpha -Counting objects: 6, done. -Compressing objects: 33% (1/3) Compressing objects: 66% (2/3) Compressing objects: 100% (3/3) Compressing objects: 100% (3/3), done. -Total 6 (delta 0), reused 0 (delta 0) importing git objects into hg 2 files updated, 0 files merged, 0 files removed, 0 files unresolved @ changeset: 1:d529e9229f6d diff --git a/tests/test-merge.out b/tests/test-merge.out index d2c4333e5f14ab690242ee9052fedb0e8ee2f4be_dGVzdHMvdGVzdC1tZXJnZS5vdXQ=..1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC1tZXJnZS5vdXQ= 100644 --- a/tests/test-merge.out +++ b/tests/test-merge.out @@ -8,9 +8,6 @@ create mode 100644 beta Initialized empty Git repository in gitrepo2/ -Counting objects: 11, done. -Compressing objects: 14% (1/7) Compressing objects: 28% (2/7) Compressing objects: 42% (3/7) Compressing objects: 57% (4/7) Compressing objects: 71% (5/7) Compressing objects: 85% (6/7) Compressing objects: 100% (7/7) Compressing objects: 100% (7/7), done. -Total 11 (delta 3), reused 0 (delta 0) importing git objects into hg 3 files updated, 0 files merged, 0 files removed, 0 files unresolved % clear the cache to be sure it is regenerated correctly diff --git a/tests/test-octopus.out b/tests/test-octopus.out index d2c4333e5f14ab690242ee9052fedb0e8ee2f4be_dGVzdHMvdGVzdC1vY3RvcHVzLm91dA==..1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC1vY3RvcHVzLm91dA== 100644 --- a/tests/test-octopus.out +++ b/tests/test-octopus.out @@ -13,9 +13,6 @@ create mode 100644 gamma Initialized empty Git repository in gitrepo2/ -Counting objects: 14, done. -Compressing objects: 11% (1/9) Compressing objects: 22% (2/9) Compressing objects: 33% (3/9) Compressing objects: 44% (4/9) Compressing objects: 55% (5/9) Compressing objects: 66% (6/9) Compressing objects: 77% (7/9) Compressing objects: 88% (8/9) Compressing objects: 100% (9/9) Compressing objects: 100% (9/9), done. -Total 14 (delta 3), reused 0 (delta 0) importing git objects into hg 4 files updated, 0 files merged, 0 files removed, 0 files unresolved @ 5:3,4 6523aa9f4775 2007-01-01 00:00 +0000 test diff --git a/tests/test-outgoing.out b/tests/test-outgoing.out index d2c4333e5f14ab690242ee9052fedb0e8ee2f4be_dGVzdHMvdGVzdC1vdXRnb2luZy5vdXQ=..1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC1vdXRnb2luZy5vdXQ= 100644 --- a/tests/test-outgoing.out +++ b/tests/test-outgoing.out @@ -1,7 +1,5 @@ Initialized empty Git repository in gitrepo/.git/ -Counting objects: 3, done. -Total 3 (delta 0), reused 0 (delta 0) importing git objects into hg 1 files updated, 0 files merged, 0 files removed, 0 files unresolved comparing with git://localhost/gitrepo @@ -47,9 +45,6 @@ abort: refs/heads/master changed on the server, please pull and merge before pushing % let's pull and try again pulling from git://localhost/gitrepo -Counting objects: 3, done. -Compressing objects: 50% (1/2) Compressing objects: 100% (2/2) Compressing objects: 100% (2/2), done. -Total 3 (delta 0), reused 0 (delta 0) importing git objects into hg (run 'hg update' to get a working copy) comparing with git://localhost/gitrepo diff --git a/tests/test-pull-after-strip.out b/tests/test-pull-after-strip.out index d2c4333e5f14ab690242ee9052fedb0e8ee2f4be_dGVzdHMvdGVzdC1wdWxsLWFmdGVyLXN0cmlwLm91dA==..1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC1wdWxsLWFmdGVyLXN0cmlwLm91dA== 100644 --- a/tests/test-pull-after-strip.out +++ b/tests/test-pull-after-strip.out @@ -2,8 +2,6 @@ Switched to a new branch "beta" % clone a tag -Counting objects: 3, done. -Total 3 (delta 0), reused 0 (delta 0) importing git objects into hg 1 files updated, 0 files merged, 0 files removed, 0 files unresolved @ changeset: 0:3442585be8a6 @@ -15,9 +13,6 @@ summary: add alpha % clone a branch -Counting objects: 6, done. -Compressing objects: 33% (1/3) Compressing objects: 66% (2/3) Compressing objects: 100% (3/3) Compressing objects: 100% (3/3), done. -Total 6 (delta 0), reused 0 (delta 0) importing git objects into hg 2 files updated, 0 files merged, 0 files removed, 0 files unresolved @ changeset: 1:7bcd915dc873 @@ -36,9 +31,6 @@ 0 files updated, 0 files merged, 1 files removed, 0 files unresolved pulling from git://localhost/gitrepo -Counting objects: 6, done. -Compressing objects: 25% (1/4) Compressing objects: 50% (2/4) Compressing objects: 75% (3/4) Compressing objects: 100% (4/4) Compressing objects: 100% (4/4), done. -Total 6 (delta 0), reused 0 (delta 0) importing git objects into hg abort: you appear to have run strip - please run hg git-cleanup git commit map cleaned diff --git a/tests/test-pull.out b/tests/test-pull.out index d2c4333e5f14ab690242ee9052fedb0e8ee2f4be_dGVzdHMvdGVzdC1wdWxsLm91dA==..1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC1wdWxsLm91dA== 100644 --- a/tests/test-pull.out +++ b/tests/test-pull.out @@ -2,8 +2,6 @@ Switched to a new branch "beta" % clone a tag -Counting objects: 3, done. -Total 3 (delta 0), reused 0 (delta 0) importing git objects into hg 1 files updated, 0 files merged, 0 files removed, 0 files unresolved @ changeset: 0:3442585be8a6 @@ -15,9 +13,6 @@ summary: add alpha % clone a branch -Counting objects: 6, done. -Compressing objects: 33% (1/3) Compressing objects: 66% (2/3) Compressing objects: 100% (3/3) Compressing objects: 100% (3/3), done. -Total 6 (delta 0), reused 0 (delta 0) importing git objects into hg 2 files updated, 0 files merged, 0 files removed, 0 files unresolved @ changeset: 1:7bcd915dc873 diff --git a/tests/test-push.out b/tests/test-push.out index d2c4333e5f14ab690242ee9052fedb0e8ee2f4be_dGVzdHMvdGVzdC1wdXNoLm91dA==..1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC1wdXNoLm91dA== 100644 --- a/tests/test-push.out +++ b/tests/test-push.out @@ -1,8 +1,6 @@ Initialized empty Git repository in gitrepo/.git/ Switched to a new branch "not-master" -Counting objects: 3, done. -Total 3 (delta 0), reused 0 (delta 0) importing git objects into hg 1 files updated, 0 files merged, 0 files removed, 0 files unresolved pushing to git://localhost/gitrepo @@ -27,9 +25,6 @@ creating and sending data abort: refs/heads/master changed on the server, please pull and merge before pushing pulling from git://localhost/gitrepo -Counting objects: 3, done. -Compressing objects: 50% (1/2) Compressing objects: 100% (2/2) Compressing objects: 100% (2/2), done. -Total 3 (delta 0), reused 0 (delta 0) importing git objects into hg (run 'hg update' to get a working copy) % master and default/master should be diferent diff --git a/tests/test-sane-without-bookmarks.out b/tests/test-sane-without-bookmarks.out index d2c4333e5f14ab690242ee9052fedb0e8ee2f4be_dGVzdHMvdGVzdC1zYW5lLXdpdGhvdXQtYm9va21hcmtzLm91dA==..1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC1zYW5lLXdpdGhvdXQtYm9va21hcmtzLm91dA== 100644 --- a/tests/test-sane-without-bookmarks.out +++ b/tests/test-sane-without-bookmarks.out @@ -1,9 +1,6 @@ Initialized empty Git repository in gitrepo/.git/ creating bookmarks failed, do you have bookmarks enabled? -Counting objects: 6, done. -Compressing objects: 33% (1/3) Compressing objects: 66% (2/3) Compressing objects: 100% (3/3) Compressing objects: 100% (3/3), done. -Total 6 (delta 0), reused 0 (delta 0) importing git objects into hg 2 files updated, 0 files merged, 0 files removed, 0 files unresolved @ changeset: 1:7bcd915dc873 diff --git a/tests/test-tree-decomposition.out b/tests/test-tree-decomposition.out index d2c4333e5f14ab690242ee9052fedb0e8ee2f4be_dGVzdHMvdGVzdC10cmVlLWRlY29tcG9zaXRpb24ub3V0..1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC10cmVlLWRlY29tcG9zaXRpb24ub3V0 100644 --- a/tests/test-tree-decomposition.out +++ b/tests/test-tree-decomposition.out @@ -2,9 +2,6 @@ Initialized empty Git repository in gitrepo2/ -Counting objects: 12, done. -Compressing objects: 16% (1/6) Compressing objects: 33% (2/6) Compressing objects: 50% (3/6) Compressing objects: 66% (4/6) Compressing objects: 83% (5/6) Compressing objects: 100% (6/6) Compressing objects: 100% (6/6), done. -Total 12 (delta 0), reused 0 (delta 0) importing git objects into hg 2 files updated, 0 files merged, 0 files removed, 0 files unresolved adds: d1 diff --git a/tests/test-url-parsing.py b/tests/test-url-parsing.py index d2c4333e5f14ab690242ee9052fedb0e8ee2f4be_dGVzdHMvdGVzdC11cmwtcGFyc2luZy5weQ==..1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC11cmwtcGFyc2luZy5weQ== 100755 --- a/tests/test-url-parsing.py +++ b/tests/test-url-parsing.py @@ -50,9 +50,25 @@ except AttributeError: self.assertEquals(client.host, 'github.com') + def test_ssh_github_style_slash_with_port(self): + url = "git+ssh://git@github.com:10022/webjam/webjam.git" + client, path = self.handler.get_transport_and_path(url) + self.assertEquals(path, '/webjam/webjam.git') + self.assertEquals(client.host, 'git@github.com') + self.assertEquals(client.port, '10022') + + def test_gitdaemon_style_with_port(self): + url = "git://github.com:19418/webjam/webjam.git" + client, path = self.handler.get_transport_and_path(url) + self.assertEquals(path, '/webjam/webjam.git') + try: + self.assertEquals(client._host, 'github.com') + except AttributeError: + self.assertEquals(client.host, 'github.com') + self.assertEquals(client._port, '19418') if __name__ == '__main__': tc = TestUrlParsing() for test in ['test_ssh_github_style_slash', 'test_ssh_github_style_colon', 'test_ssh_heroku_style', @@ -53,10 +69,12 @@ if __name__ == '__main__': tc = TestUrlParsing() for test in ['test_ssh_github_style_slash', 'test_ssh_github_style_colon', 'test_ssh_heroku_style', - 'test_gitdaemon_style']: + 'test_gitdaemon_style', + 'test_ssh_github_style_slash_with_port', + 'test_gitdaemon_style_with_port']: tc.setUp() getattr(tc, test)() tc.tearDown() diff --git a/tests/test-url-parsing.py.out b/tests/test-url-parsing.py.out index d2c4333e5f14ab690242ee9052fedb0e8ee2f4be_dGVzdHMvdGVzdC11cmwtcGFyc2luZy5weS5vdXQ=..1189a4f3e2389ed831acd1e364a118253cf9fbaa_dGVzdHMvdGVzdC11cmwtcGFyc2luZy5weS5vdXQ= 100644 --- a/tests/test-url-parsing.py.out +++ b/tests/test-url-parsing.py.out @@ -14,3 +14,15 @@ /webjam/webjam.git % expect 'github.com' github.com +% expect '/webjam/webjam.git' +/webjam/webjam.git +% expect 'git@github.com' +git@github.com +% expect '10022' +10022 +% expect '/webjam/webjam.git' +/webjam/webjam.git +% expect 'github.com' +github.com +% expect '19418' +19418