mirror of
				https://github.com/mnauw/git-remote-hg.git
				synced 2025-10-31 16:45:48 +01:00 
			
		
		
		
	Compare commits
	
		
			3 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | e71a8963af | ||
|  | f20dbc33c3 | ||
|  | e4aeae6d4b | 
| @@ -5,13 +5,14 @@ install: | |||||||
|     then pip install -q Mercurial${HG_VERSION+==$HG_VERSION}; |     then pip install -q Mercurial${HG_VERSION+==$HG_VERSION}; | ||||||
|     else pip install -q http://selenic.com/repo/hg/archive/tip.tar.gz; |     else pip install -q http://selenic.com/repo/hg/archive/tip.tar.gz; | ||||||
|     fi |     fi | ||||||
|   - pip install -q dulwich hg-git==0.6.1 || true |   - pip install -q dulwich hg-git || true | ||||||
|  |  | ||||||
| before_script: | before_script: | ||||||
|   - hg --version || true |   - hg --version || true | ||||||
|   - pip show hg-git dulwich |   - pip show hg-git dulwich | ||||||
|  |  | ||||||
| script: | script: | ||||||
|  |   - export TEST_OPTS='-v' | ||||||
|   - make test |   - make test | ||||||
|  |  | ||||||
| matrix: | matrix: | ||||||
| @@ -20,9 +21,6 @@ matrix: | |||||||
|     - env: HG_VERSION=2.8.2 |     - env: HG_VERSION=2.8.2 | ||||||
|     - env: HG_VERSION=2.7.2 |     - env: HG_VERSION=2.7.2 | ||||||
|     - env: HG_VERSION=3.0 |     - env: HG_VERSION=3.0 | ||||||
|     - env: HG_VERSION=3.5.2 |  | ||||||
|     - env: HG_VERSION=3.6.3 |  | ||||||
|     - env: HG_VERSION=3.7 |  | ||||||
|     - env: HG_VERSION=dev |     - env: HG_VERSION=dev | ||||||
|     - python: 2.7 |     - python: 2.7 | ||||||
|     - python: 2.6 |     - python: 2.6 | ||||||
|   | |||||||
| @@ -15,8 +15,6 @@ chmod +x ~/bin/git-remote-hg | |||||||
|  |  | ||||||
| That's it :) | That's it :) | ||||||
|  |  | ||||||
| Obviously you will need Mercurial installed. |  | ||||||
|  |  | ||||||
| == Configuration == | == Configuration == | ||||||
|  |  | ||||||
| If you want to see Mercurial revisions as Git commit notes: | If you want to see Mercurial revisions as Git commit notes: | ||||||
|   | |||||||
| @@ -430,11 +430,6 @@ def get_repo(url, alias): | |||||||
|             peer = hg.peer(repo.ui, {}, url) |             peer = hg.peer(repo.ui, {}, url) | ||||||
|         except: |         except: | ||||||
|             die('Repository error') |             die('Repository error') | ||||||
|  |  | ||||||
|         if check_version(3, 0): |  | ||||||
|             from mercurial import exchange |  | ||||||
|             exchange.pull(repo, peer, heads=None, force=True) |  | ||||||
|         else: |  | ||||||
|         repo.pull(peer, heads=None, force=True) |         repo.pull(peer, heads=None, force=True) | ||||||
|  |  | ||||||
|         updatebookmarks(repo, peer) |         updatebookmarks(repo, peer) | ||||||
| @@ -503,7 +498,7 @@ def export_ref(repo, name, kind, head): | |||||||
|         if 'committer' in extra: |         if 'committer' in extra: | ||||||
|             try: |             try: | ||||||
|                 cuser, ctime, ctz = extra['committer'].rsplit(' ', 2) |                 cuser, ctime, ctz = extra['committer'].rsplit(' ', 2) | ||||||
|                 committer = "%s %s %s" % (fixup_user(cuser), ctime, gittz(int(ctz))) |                 committer = "%s %s %s" % (cuser, ctime, gittz(int(ctz))) | ||||||
|             except ValueError: |             except ValueError: | ||||||
|                 cuser = extra['committer'] |                 cuser = extra['committer'] | ||||||
|                 committer = "%s %d %s" % (fixup_user(cuser), time, gittz(tz)) |                 committer = "%s %d %s" % (fixup_user(cuser), time, gittz(tz)) | ||||||
| @@ -808,22 +803,8 @@ def parse_commit(parser): | |||||||
|     def getfilectx(repo, memctx, f): |     def getfilectx(repo, memctx, f): | ||||||
|         of = files[f] |         of = files[f] | ||||||
|         if 'deleted' in of: |         if 'deleted' in of: | ||||||
|             if check_version(3, 2): |  | ||||||
|                 return None |  | ||||||
|             else: |  | ||||||
|             raise IOError |             raise IOError | ||||||
|         if 'ctx' in of: |         if 'ctx' in of: | ||||||
|             if mode == 'hg': |  | ||||||
|                 ctx = of['ctx'] |  | ||||||
|                 is_exec = ctx.isexec() |  | ||||||
|                 is_link = ctx.islink() |  | ||||||
|                 if check_version(3, 1): |  | ||||||
|                     return context.memfilectx(repo, f, ctx.data(), |  | ||||||
|                             is_link, is_exec) |  | ||||||
|                 else: |  | ||||||
|                     return context.memfilectx(f, ctx.data(), |  | ||||||
|                             is_link, is_exec) |  | ||||||
|             else: |  | ||||||
|             return of['ctx'] |             return of['ctx'] | ||||||
|         is_exec = of['mode'] == 'x' |         is_exec = of['mode'] == 'x' | ||||||
|         is_link = of['mode'] == 'l' |         is_link = of['mode'] == 'l' | ||||||
| @@ -1055,9 +1036,7 @@ def push_unsafe(repo, remote, parsed_refs, p_revs): | |||||||
|     if not checkheads(repo, remote, p_revs): |     if not checkheads(repo, remote, p_revs): | ||||||
|         return None |         return None | ||||||
|  |  | ||||||
|     if check_version(3, 2): |     if check_version(3, 0): | ||||||
|         cg = changegroup.getchangegroup(repo, 'push', heads=list(p_revs), common=common) |  | ||||||
|     elif check_version(3, 0): |  | ||||||
|         cg = changegroup.getbundle(repo, 'push', heads=list(p_revs), common=common) |         cg = changegroup.getbundle(repo, 'push', heads=list(p_revs), common=common) | ||||||
|     else: |     else: | ||||||
|         cg = repo.getbundle('push', heads=list(p_revs), common=common) |         cg = repo.getbundle('push', heads=list(p_revs), common=common) | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| RM ?= rm -f | RM ?= rm -f | ||||||
|  |  | ||||||
| T = main.t bidi.t | T = $(wildcard *.t) | ||||||
| TEST_DIRECTORY := $(CURDIR) | TEST_DIRECTORY := $(CURDIR) | ||||||
|  |  | ||||||
| export TEST_DIRECTORY | export TEST_DIRECTORY | ||||||
|   | |||||||
| @@ -36,6 +36,8 @@ fi | |||||||
|  |  | ||||||
| hg_version=$(python2 -c 'from mercurial import util; print util.version()') | hg_version=$(python2 -c 'from mercurial import util; print util.version()') | ||||||
|  |  | ||||||
|  | echo "hg_version: $hg_version" | ||||||
|  |  | ||||||
| case $hg_version in | case $hg_version in | ||||||
| 3.0*+*) | 3.0*+*) | ||||||
| 	skip_all='skipping remote-hg tests; unsuported version of hg by hg-git' | 	skip_all='skipping remote-hg tests; unsuported version of hg by hg-git' | ||||||
| @@ -115,6 +117,7 @@ setup () { | |||||||
| 	debugrawcommit = -d "0 0" | 	debugrawcommit = -d "0 0" | ||||||
| 	tag = -d "0 0" | 	tag = -d "0 0" | ||||||
| 	[extensions] | 	[extensions] | ||||||
|  | 	hgext.bookmarks = | ||||||
| 	$hggit = | 	$hggit = | ||||||
| 	graphlog = | 	graphlog = | ||||||
| 	EOF | 	EOF | ||||||
|   | |||||||
| @@ -470,7 +470,7 @@ rm -rf hgrepo | |||||||
| test_expect_success 'fetch special filenames' ' | test_expect_success 'fetch special filenames' ' | ||||||
| 	test_when_finished "rm -rf hgrepo gitrepo && LC_ALL=C" && | 	test_when_finished "rm -rf hgrepo gitrepo && LC_ALL=C" && | ||||||
|  |  | ||||||
| 	LC_ALL=en_US.UTF-8 | 	LC_ALL=C.UTF-8 | ||||||
| 	export LC_ALL | 	export LC_ALL | ||||||
|  |  | ||||||
| 	( | 	( | ||||||
| @@ -503,7 +503,7 @@ test_expect_success 'push special filenames' ' | |||||||
|  |  | ||||||
| 	mkdir -p tmp && cd tmp && | 	mkdir -p tmp && cd tmp && | ||||||
|  |  | ||||||
| 	LC_ALL=en_US.UTF-8 | 	LC_ALL=C.UTF-8 | ||||||
| 	export LC_ALL | 	export LC_ALL | ||||||
|  |  | ||||||
| 	( | 	( | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user