mirror of
				https://github.com/mnauw/git-remote-hg.git
				synced 2025-11-03 10:05:48 +01:00 
			
		
		
		
	Compare commits
	
		
			251 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					8a137f53f8 | ||
| 
						 | 
					c13e36f215 | ||
| 
						 | 
					fbeaffb15c | ||
| 
						 | 
					a96f368f2a | ||
| 
						 | 
					301552278a | ||
| 
						 | 
					fddbbfe990 | ||
| 
						 | 
					c329c9690a | ||
| 
						 | 
					6c36268028 | ||
| 
						 | 
					893dd9434f | ||
| 
						 | 
					4ddbfeb9c8 | ||
| 
						 | 
					93271a4e1b | ||
| 
						 | 
					36706dffe6 | ||
| 
						 | 
					da532bf6f4 | ||
| 
						 | 
					aa1d0bc152 | ||
| 
						 | 
					bdbe62256a | ||
| 
						 | 
					8acf139e44 | ||
| 
						 | 
					1df692295c | ||
| 
						 | 
					027e1a16f0 | ||
| 
						 | 
					723e6c76fc | ||
| 
						 | 
					2529c986c2 | ||
| 
						 | 
					ab398ade1d | ||
| 
						 | 
					e1d25cf97c | ||
| 
						 | 
					0fe1e359ec | ||
| 
						 | 
					498c615051 | ||
| 
						 | 
					6b6aa9deaa | ||
| 
						 | 
					2685f56c7c | ||
| 
						 | 
					3314ce3dda | ||
| 
						 | 
					408333afca | ||
| 
						 | 
					c861db6add | ||
| 
						 | 
					d2a3a646af | ||
| 
						 | 
					f00911668a | ||
| 
						 | 
					474cacd81d | ||
| 
						 | 
					e4d87d5e2c | ||
| 
						 | 
					615cc7fe04 | ||
| 
						 | 
					79e75991ab | ||
| 
						 | 
					b029ac0500 | ||
| 
						 | 
					7713b7ecef | ||
| 
						 | 
					b274b8057e | ||
| 
						 | 
					451e31022a | ||
| 
						 | 
					9c61c09ebf | ||
| 
						 | 
					463f397ba4 | ||
| 
						 | 
					e774ad2d96 | ||
| 
						 | 
					086ca23507 | ||
| 
						 | 
					7c373be665 | ||
| 
						 | 
					3bfec5fc6f | ||
| 
						 | 
					7908c70efb | ||
| 
						 | 
					7cff2c6adb | ||
| 
						 | 
					9c5b8835f4 | ||
| 
						 | 
					537e5a4735 | ||
| 
						 | 
					8025945a62 | ||
| 
						 | 
					33dccdfab0 | ||
| 
						 | 
					4ad9c8d70c | ||
| 
						 | 
					740c681c1d | ||
| 
						 | 
					995179444c | ||
| 
						 | 
					e6c479c136 | ||
| 
						 | 
					b8b9a2f571 | ||
| 
						 | 
					4c50223dba | ||
| 
						 | 
					35d32d5a75 | ||
| 
						 | 
					7f6a843f0d | ||
| 
						 | 
					63cf2780ba | ||
| 
						 | 
					f032d3617b | ||
| 
						 | 
					60a1d7ae7a | ||
| 
						 | 
					10aec96d88 | ||
| 
						 | 
					9b54c626bc | ||
| 
						 | 
					d51f508916 | ||
| 
						 | 
					9916fead46 | ||
| 
						 | 
					09c4726083 | ||
| 
						 | 
					bb663c032f | ||
| 
						 | 
					b590aec106 | ||
| 
						 | 
					4496af4a5c | ||
| 
						 | 
					890080673b | ||
| 
						 | 
					5e6ef0a1d5 | ||
| 
						 | 
					a1e2c4acc9 | ||
| 
						 | 
					7196dac02d | ||
| 
						 | 
					a8bb2a28a3 | ||
| 
						 | 
					ffcb41cc52 | ||
| 
						 | 
					9949745533 | ||
| 
						 | 
					83620648ab | ||
| 
						 | 
					30a2d61bdf | ||
| 
						 | 
					2fdb786fc4 | ||
| 
						 | 
					79797918ff | ||
| 
						 | 
					d45d5cde50 | ||
| 
						 | 
					7078666c77 | ||
| 
						 | 
					08e453f8db | ||
| 
						 | 
					ec7119d0ef | ||
| 
						 | 
					6ae5e3961e | ||
| 
						 | 
					b4c3277f72 | ||
| 
						 | 
					de9bf35388 | ||
| 
						 | 
					857d68708b | ||
| 
						 | 
					7394fc890e | ||
| 
						 | 
					22229dd738 | ||
| 
						 | 
					5cd03ad0fd | ||
| 
						 | 
					bf7ad934d7 | ||
| 
						 | 
					426ed618b2 | ||
| 
						 | 
					5f34d049b9 | ||
| 
						 | 
					ea7e9bf31a | ||
| 
						 | 
					a3a36883c5 | ||
| 
						 | 
					0fdd28319a | ||
| 
						 | 
					a5bc03d4d6 | ||
| 
						 | 
					104e8895d6 | ||
| 
						 | 
					30f31c13ce | ||
| 
						 | 
					485806e1e3 | ||
| 
						 | 
					6e13c1c818 | ||
| 
						 | 
					ce38d52ce5 | ||
| 
						 | 
					6b8ee2f1b6 | ||
| 
						 | 
					b3b9b5de39 | ||
| 
						 | 
					34ba087896 | ||
| 
						 | 
					4aec2fe3cc | ||
| 
						 | 
					e892cb6ce3 | ||
| 
						 | 
					59ad50c6d0 | ||
| 
						 | 
					b8c8b1fd00 | ||
| 
						 | 
					0cf8b2c20a | ||
| 
						 | 
					8c3cde6be7 | ||
| 
						 | 
					ccee8909ff | ||
| 
						 | 
					dd6b72df21 | ||
| 
						 | 
					01d619ad3c | ||
| 
						 | 
					9d45e70fce | ||
| 
						 | 
					055cec1aa7 | ||
| 
						 | 
					7d50fa42c1 | ||
| 
						 | 
					f6676e6d86 | ||
| 
						 | 
					cac075744d | ||
| 
						 | 
					19633eaf36 | ||
| 
						 | 
					900a55e974 | ||
| 
						 | 
					d1f60c445e | ||
| 
						 | 
					bd3f404d34 | ||
| 
						 | 
					dcf96f31db | ||
| 
						 | 
					795b88e16c | ||
| 
						 | 
					20366b4b20 | ||
| 
						 | 
					1f5134062e | ||
| 
						 | 
					2313dc2ca0 | ||
| 
						 | 
					0e52a6c883 | ||
| 
						 | 
					e24a713dc9 | ||
| 
						 | 
					122b7f5da2 | ||
| 
						 | 
					98c1c9263e | ||
| 
						 | 
					85293dcf69 | ||
| 
						 | 
					970883c46c | ||
| 
						 | 
					ad77f125b7 | ||
| 
						 | 
					5dcd6df3c8 | ||
| 
						 | 
					ed80437db4 | ||
| 
						 | 
					0a1e8ecbc7 | ||
| 
						 | 
					6d6504d1fd | ||
| 
						 | 
					237ff083af | ||
| 
						 | 
					0c8f8571c7 | ||
| 
						 | 
					1442c29d39 | ||
| 
						 | 
					dfa3ad5fca | ||
| 
						 | 
					ebd5bdb111 | ||
| 
						 | 
					00ac711fb2 | ||
| 
						 | 
					aadc899982 | ||
| 
						 | 
					4d38bff053 | ||
| 
						 | 
					a8cd6a92b3 | ||
| 
						 | 
					a08ad9d2b4 | ||
| 
						 | 
					8c08b6de21 | ||
| 
						 | 
					949345fb11 | ||
| 
						 | 
					0d49f75131 | ||
| 
						 | 
					7159e4a030 | ||
| 
						 | 
					cdcd70b453 | ||
| 
						 | 
					f5c38f3a59 | ||
| 
						 | 
					3b11156e69 | ||
| 
						 | 
					afc1f3a2c2 | ||
| 
						 | 
					e596a5f457 | ||
| 
						 | 
					ec654d4682 | ||
| 
						 | 
					7913920a97 | ||
| 
						 | 
					da60201ae3 | ||
| 
						 | 
					704869df29 | ||
| 
						 | 
					5769e965eb | ||
| 
						 | 
					1ee28bd233 | ||
| 
						 | 
					1796289df3 | ||
| 
						 | 
					929ae262f5 | ||
| 
						 | 
					4328aa1c19 | ||
| 
						 | 
					919678be4a | ||
| 
						 | 
					ac8f659620 | ||
| 
						 | 
					28ed63b707 | ||
| 
						 | 
					dc91c58e1c | ||
| 
						 | 
					46178f546a | ||
| 
						 | 
					4c0e8e6439 | ||
| 
						 | 
					59b5a8c848 | ||
| 
						 | 
					be2445963b | ||
| 
						 | 
					8b4bfe7e87 | ||
| 
						 | 
					741b440fcc | ||
| 
						 | 
					03b1ac9845 | ||
| 
						 | 
					f3a8546406 | ||
| 
						 | 
					ccc9e55b7e | ||
| 
						 | 
					b516aa9326 | ||
| 
						 | 
					08626200d0 | ||
| 
						 | 
					b60eb47173 | ||
| 
						 | 
					76162ce148 | ||
| 
						 | 
					7ae03f7640 | ||
| 
						 | 
					95da53badd | ||
| 
						 | 
					a0608664ca | ||
| 
						 | 
					9d6d135855 | ||
| 
						 | 
					60a6c7b36d | ||
| 
						 | 
					74d1aa14ac | ||
| 
						 | 
					1d85449b0b | ||
| 
						 | 
					fe8b8c1a61 | ||
| 
						 | 
					510441bba9 | ||
| 
						 | 
					fa3484e08b | ||
| 
						 | 
					d1544e2ccd | ||
| 
						 | 
					153a216f47 | ||
| 
						 | 
					b3cdbe8e96 | ||
| 
						 | 
					d11509cab7 | ||
| 
						 | 
					4d01165b1b | ||
| 
						 | 
					a030d603ac | ||
| 
						 | 
					3d4a5a6d7e | ||
| 
						 | 
					7fb9d9b642 | ||
| 
						 | 
					fad59f53eb | ||
| 
						 | 
					e17e147fb1 | ||
| 
						 | 
					4878023a8b | ||
| 
						 | 
					0dfae24d21 | ||
| 
						 | 
					c7dbb5612b | ||
| 
						 | 
					cc4e5659d9 | ||
| 
						 | 
					2c993b3433 | ||
| 
						 | 
					4944a384cd | ||
| 
						 | 
					f29c42c645 | ||
| 
						 | 
					7b7c65f72d | ||
| 
						 | 
					cee3ed7c00 | ||
| 
						 | 
					01c9a981c7 | ||
| 
						 | 
					d0a5888580 | ||
| 
						 | 
					a5dfc9025b | ||
| 
						 | 
					4d337cff06 | ||
| 
						 | 
					5cc271ef18 | ||
| 
						 | 
					c8fff2cd06 | ||
| 
						 | 
					c95fba3c18 | ||
| 
						 | 
					aaef56a2a3 | ||
| 
						 | 
					a16c69a99c | ||
| 
						 | 
					00e95fd8df | ||
| 
						 | 
					5bf7aad6e3 | ||
| 
						 | 
					9b8e0ec2c0 | ||
| 
						 | 
					b309562574 | ||
| 
						 | 
					e25d3d78cd | ||
| 
						 | 
					ed5a70706a | ||
| 
						 | 
					0faf2c9189 | ||
| 
						 | 
					ada49422a7 | ||
| 
						 | 
					580cea0d31 | ||
| 
						 | 
					1f376e437f | ||
| 
						 | 
					4108665799 | ||
| 
						 | 
					fc28115a53 | ||
| 
						 | 
					e3009683f8 | ||
| 
						 | 
					54cec85f94 | ||
| 
						 | 
					5ad322c54d | ||
| 
						 | 
					13bbc8a342 | ||
| 
						 | 
					673b50d3f4 | ||
| 
						 | 
					35ecb45fda | ||
| 
						 | 
					1456e68129 | ||
| 
						 | 
					de95133416 | ||
| 
						 | 
					e0b752be8f | ||
| 
						 | 
					f050de1bcc | ||
| 
						 | 
					0bf3db826b | ||
| 
						 | 
					3698638e98 | ||
| 
						 | 
					765f9ae287 | ||
| 
						 | 
					5ddcdd33ec | ||
| 
						 | 
					435373ee83 | 
							
								
								
									
										25
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,25 @@
 | 
				
			|||||||
 | 
					name: CI
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					on:
 | 
				
			||||||
 | 
					  push:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					jobs:
 | 
				
			||||||
 | 
					  test:
 | 
				
			||||||
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					    strategy:
 | 
				
			||||||
 | 
					      matrix:
 | 
				
			||||||
 | 
					        hg: [ '6.0', '6.1', '6.2', '6.3', '6.4', '6.5', '6.6', '6.7', '6.8', '6.9' ]
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					      - uses: actions/checkout@v3
 | 
				
			||||||
 | 
					      - uses: actions/setup-python@v4
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          python-version: '3.10'
 | 
				
			||||||
 | 
					      - uses: actions/cache@v3
 | 
				
			||||||
 | 
					        id: cache-pip
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          path: ~/.cache/pip
 | 
				
			||||||
 | 
					          key: pip
 | 
				
			||||||
 | 
					      - name: Install hg
 | 
				
			||||||
 | 
					        run:
 | 
				
			||||||
 | 
					          pip install mercurial==${{ matrix.hg }}
 | 
				
			||||||
 | 
					      - run: make test
 | 
				
			||||||
							
								
								
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
				
			|||||||
 | 
					/build/
 | 
				
			||||||
 | 
					/dist/
 | 
				
			||||||
 | 
					/git_remote_hg.egg-info/
 | 
				
			||||||
							
								
								
									
										28
									
								
								.travis.yml
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								.travis.yml
									
									
									
									
									
								
							@@ -1,28 +0,0 @@
 | 
				
			|||||||
language: python
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
install:
 | 
					 | 
				
			||||||
  - if [ "$HG_VERSION" != "dev" ];
 | 
					 | 
				
			||||||
    then pip install -q Mercurial${HG_VERSION+==$HG_VERSION};
 | 
					 | 
				
			||||||
    else pip install -q http://selenic.com/repo/hg/archive/tip.tar.gz;
 | 
					 | 
				
			||||||
    fi
 | 
					 | 
				
			||||||
  - pip install -q dulwich hg-git==0.6.1 || true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
before_script:
 | 
					 | 
				
			||||||
  - hg --version || true
 | 
					 | 
				
			||||||
  - pip show hg-git dulwich
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
script:
 | 
					 | 
				
			||||||
  - make test
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
matrix:
 | 
					 | 
				
			||||||
  include:
 | 
					 | 
				
			||||||
    - env: HG_VERSION=2.9.1
 | 
					 | 
				
			||||||
    - env: HG_VERSION=2.8.2
 | 
					 | 
				
			||||||
    - env: HG_VERSION=2.7.2
 | 
					 | 
				
			||||||
    - 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
 | 
					 | 
				
			||||||
    - python: 2.7
 | 
					 | 
				
			||||||
    - python: 2.6
 | 
					 | 
				
			||||||
							
								
								
									
										45
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										45
									
								
								Makefile
									
									
									
									
									
								
							@@ -3,7 +3,28 @@ prefix := $(HOME)
 | 
				
			|||||||
bindir := $(prefix)/bin
 | 
					bindir := $(prefix)/bin
 | 
				
			||||||
mandir := $(prefix)/share/man/man1
 | 
					mandir := $(prefix)/share/man/man1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
all: doc
 | 
					all: build doc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					build:
 | 
				
			||||||
 | 
						if [ -n "$$PYTHON" ] && "$$PYTHON" -c 'import mercurial' 2> /dev/null ; then \
 | 
				
			||||||
 | 
							: Use chosen Python version ; \
 | 
				
			||||||
 | 
						elif python3 -c 'import mercurial' 2> /dev/null ; then \
 | 
				
			||||||
 | 
							PYTHON=python3 ; \
 | 
				
			||||||
 | 
						elif python2 -c 'import mercurial' 2> /dev/null ; then \
 | 
				
			||||||
 | 
							PYTHON=python2 ; \
 | 
				
			||||||
 | 
						elif python -c 'import mercurial' 2> /dev/null ; then \
 | 
				
			||||||
 | 
							PYTHON=python ; \
 | 
				
			||||||
 | 
						else \
 | 
				
			||||||
 | 
							echo 'Python with Mercurial not available' >&2 ; \
 | 
				
			||||||
 | 
							exit 1 ; \
 | 
				
			||||||
 | 
						fi ; \
 | 
				
			||||||
 | 
						mkdir -p bin ; \
 | 
				
			||||||
 | 
						for s in git-remote-hg git-hg-helper ; do \
 | 
				
			||||||
 | 
							printf "%s\n" "#!/usr/bin/env $$PYTHON" > "bin/$$s" ; \
 | 
				
			||||||
 | 
							tail -n +2 "./$$s" >> "bin/$$s" ; \
 | 
				
			||||||
 | 
							chmod 755 "bin/$$s" ; \
 | 
				
			||||||
 | 
							touch -r "./$$s" "bin/$$s" ; \
 | 
				
			||||||
 | 
						done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
doc: doc/git-remote-hg.1
 | 
					doc: doc/git-remote-hg.1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -11,19 +32,33 @@ test:
 | 
				
			|||||||
	$(MAKE) -C test
 | 
						$(MAKE) -C test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
doc/git-remote-hg.1: doc/git-remote-hg.txt
 | 
					doc/git-remote-hg.1: doc/git-remote-hg.txt
 | 
				
			||||||
	a2x -d manpage -f manpage $<
 | 
						asciidoctor -d manpage -b manpage $<
 | 
				
			||||||
 | 
					
 | 
				
			||||||
clean:
 | 
					clean:
 | 
				
			||||||
	$(RM) doc/git-remote-hg.1
 | 
						$(RM) doc/git-remote-hg.1
 | 
				
			||||||
 | 
						$(RM) -r bin/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
D = $(DESTDIR)
 | 
					D = $(DESTDIR)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
install:
 | 
					install: build
 | 
				
			||||||
	install -d -m 755 $(D)$(bindir)/
 | 
						install -d -m 755 $(D)$(bindir)/
 | 
				
			||||||
	install -m 755 git-remote-hg $(D)$(bindir)/git-remote-hg
 | 
						install -m 755 bin/git-remote-hg $(D)$(bindir)/git-remote-hg
 | 
				
			||||||
 | 
						install -m 755 bin/git-hg-helper $(D)$(bindir)/git-hg-helper
 | 
				
			||||||
 | 
					
 | 
				
			||||||
install-doc: doc
 | 
					install-doc: doc
 | 
				
			||||||
	install -d -m 755 $(D)$(mandir)/
 | 
						install -d -m 755 $(D)$(mandir)/
 | 
				
			||||||
	install -m 644 doc/git-remote-hg.1 $(D)$(mandir)/git-remote-hg.1
 | 
						install -m 644 doc/git-remote-hg.1 $(D)$(mandir)/git-remote-hg.1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.PHONY: all test install install-doc clean
 | 
					pypi:
 | 
				
			||||||
 | 
						version=`git describe --tags ${REV}` && \
 | 
				
			||||||
 | 
							sed -i "s/version = .*/version = '$$version'[1:]/" setup.py
 | 
				
			||||||
 | 
						-rm -rf dist build
 | 
				
			||||||
 | 
						python setup.py sdist bdist_wheel
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pypi-upload:
 | 
				
			||||||
 | 
						twine upload dist/*
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pypi-test:
 | 
				
			||||||
 | 
						twine upload --repository-url https://test.pypi.org/legacy/ dist/*
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.PHONY: all build test install install-doc clean pypy pypy-upload
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
'git-remote-hg' is the semi-official Mercurial bridge from Git project, once
 | 
					`git-remote-hg` is the semi-official Mercurial bridge from the Git project, once
 | 
				
			||||||
installed, it allows you to clone, fetch and push to and from Mercurial
 | 
					installed, it allows you to clone, fetch and push to and from Mercurial
 | 
				
			||||||
repositories as if they were Git ones:
 | 
					repositories as if they were Git ones:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -6,13 +6,20 @@ repositories as if they were Git ones:
 | 
				
			|||||||
git clone "hg::http://selenic.com/repo/hello"
 | 
					git clone "hg::http://selenic.com/repo/hello"
 | 
				
			||||||
--------------------------------------
 | 
					--------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
To enable this, simply add the 'git-remote-hg' script anywhere in your `$PATH`:
 | 
					To enable this, simply add the `git-remote-hg` script anywhere in your `$PATH`:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--------------------------------------
 | 
					--------------------------------------
 | 
				
			||||||
wget https://raw.github.com/mnauw/git-remote-hg/master/git-remote-hg -O ~/bin/git-remote-hg
 | 
					wget https://raw.githubusercontent.com/mnauw/git-remote-hg/master/git-remote-hg -O ~/bin/git-remote-hg
 | 
				
			||||||
chmod +x ~/bin/git-remote-hg
 | 
					chmod +x ~/bin/git-remote-hg
 | 
				
			||||||
--------------------------------------
 | 
					--------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					In Windows, you also need to put and an NTFS symbolic link named `python2.exe` somewhere
 | 
				
			||||||
 | 
					on your `$PATH` pointing to your Python 2 executable:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--------------------------------------
 | 
				
			||||||
 | 
					mklink <path to link> <path to python.exe>
 | 
				
			||||||
 | 
					--------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
That's it :)
 | 
					That's it :)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Obviously you will need Mercurial installed.
 | 
					Obviously you will need Mercurial installed.
 | 
				
			||||||
@@ -42,7 +49,8 @@ If you want to see Mercurial revisions as Git commit notes:
 | 
				
			|||||||
% git config core.notesRef refs/notes/hg
 | 
					% git config core.notesRef refs/notes/hg
 | 
				
			||||||
--------------------------------------
 | 
					--------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
If you are not interested in Mercurial permanent and global branches (aka. commit labels):
 | 
					If you are not interested in Mercurial permanent and global branches (aka.
 | 
				
			||||||
 | 
					commit labels):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--------------------------------------
 | 
					--------------------------------------
 | 
				
			||||||
% git config --global remote-hg.track-branches false
 | 
					% git config --global remote-hg.track-branches false
 | 
				
			||||||
@@ -50,29 +58,41 @@ If you are not interested in Mercurial permanent and global branches (aka. commi
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
With this configuration, the 'branches/foo' refs won't appear.
 | 
					With this configuration, the 'branches/foo' refs won't appear.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
If you want the equivalent of 'hg clone --insecure':
 | 
					If you want the equivalent of `hg clone --insecure`:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--------------------------------------
 | 
					--------------------------------------
 | 
				
			||||||
% git config --global remote-hg.insecure true
 | 
					% git config --global remote-hg.insecure true
 | 
				
			||||||
--------------------------------------
 | 
					--------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
If you want 'git-remote-hg' to be compatible with 'hg-git', and generate exactly the same commits:
 | 
					If you want `git-remote-hg` to be compatible with `hg-git`, and generate exactly
 | 
				
			||||||
 | 
					the same commits:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--------------------------------------
 | 
					--------------------------------------
 | 
				
			||||||
% git config --global remote-hg.hg-git-compat true
 | 
					% git config --global remote-hg.hg-git-compat true
 | 
				
			||||||
--------------------------------------
 | 
					--------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					****
 | 
				
			||||||
 | 
					mnauw's note; The above is not quite the case, it only ever has been (somewhat) if
 | 
				
			||||||
 | 
					an undocumented debug mode was enabled in `hg-git` (`debugextrainmessage` setting),
 | 
				
			||||||
 | 
					and in recent versions the latter is no longer considered.  In fact, `hg-git` creates
 | 
				
			||||||
 | 
					git commits with additional hg metadata stored in so-called "extra commit headers".
 | 
				
			||||||
 | 
					The latter might be seen by `git log --format=raw` or `git cat-file -p <commitid>`,
 | 
				
			||||||
 | 
					but are otherwise mostly used internally by the git suite (for signatures).  However,
 | 
				
			||||||
 | 
					there is limited to no support for those in git "porcelain or plumbing" commands.
 | 
				
			||||||
 | 
					In particular, `git fast-export` and `git fast-import` do not consider these,
 | 
				
			||||||
 | 
					so a `gitremote-helpers` tool is then also out of luck.  Incidentally, it also
 | 
				
			||||||
 | 
					follows that a `git fast-export | git fast-import` "clone" approach would also
 | 
				
			||||||
 | 
					lose such extra metadata, and likewise so for e.g. `git filter-repo`.
 | 
				
			||||||
 | 
					****
 | 
				
			||||||
 | 
					
 | 
				
			||||||
== Notes ==
 | 
					== Notes ==
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Remember to run `git gc --aggressive` after cloning a repository, specially if
 | 
					Remember to run `git gc --aggressive` after cloning a repository, especially if
 | 
				
			||||||
it's a big one. Otherwise lots of space will be wasted.
 | 
					it's a big one. Otherwise lots of space will be wasted.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The oldest version of mercurial supported is 1.9. For the most part 1.8 works,
 | 
					 | 
				
			||||||
but you might experience some issues.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=== Pushing branches ===
 | 
					=== Pushing branches ===
 | 
				
			||||||
 | 
					
 | 
				
			||||||
To push a branch, you need to use the "branches/" prefix:
 | 
					To push a branch, you need to use the 'branches/' prefix:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--------------------------------------
 | 
					--------------------------------------
 | 
				
			||||||
% git checkout branches/next
 | 
					% git checkout branches/next
 | 
				
			||||||
@@ -82,7 +102,7 @@ To push a branch, you need to use the "branches/" prefix:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
All the pushed commits will receive the "next" Mercurial named branch.
 | 
					All the pushed commits will receive the "next" Mercurial named branch.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
*Note*: Make sure you don't have +remote-hg.track-branches+ disabled.
 | 
					*Note*: Make sure you don't have `remote-hg.track-branches` disabled.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=== Cloning HTTPS ===
 | 
					=== Cloning HTTPS ===
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -92,7 +112,7 @@ The simplest way is to specify the user and password in the URL:
 | 
				
			|||||||
git clone hg::https://user:password@bitbucket.org/user/repo
 | 
					git clone hg::https://user:password@bitbucket.org/user/repo
 | 
				
			||||||
--------------------------------------
 | 
					--------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
You can also use the http://mercurial.selenic.com/wiki/SchemesExtension[schemes extension]:
 | 
					You can also use the https://mercurial-scm.org/wiki/SchemesExtension[schemes extension]:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--------------------------------------
 | 
					--------------------------------------
 | 
				
			||||||
[auth]
 | 
					[auth]
 | 
				
			||||||
@@ -102,11 +122,7 @@ bb.password = password
 | 
				
			|||||||
--------------------------------------
 | 
					--------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Finally, you can also use the
 | 
					Finally, you can also use the
 | 
				
			||||||
https://pypi.python.org/pypi/mercurial_keyring[keyring extension].
 | 
					https://pypi.org/project/mercurial_keyring[keyring extension].
 | 
				
			||||||
 | 
					 | 
				
			||||||
However, some of these features require very new versions of 'git-remote-hg',
 | 
					 | 
				
			||||||
so you might have better luck simply specifying the username and password in
 | 
					 | 
				
			||||||
the URL.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
=== Submodules ===
 | 
					=== Submodules ===
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -134,10 +150,10 @@ Mercurial branches and bookmarks have some limitations of Git branches: you
 | 
				
			|||||||
can't have both 'dev/feature' and 'dev' (as Git uses files and directories to
 | 
					can't have both 'dev/feature' and 'dev' (as Git uses files and directories to
 | 
				
			||||||
store them).
 | 
					store them).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Multiple anonymous heads (which are useless anyway) are not supported; you
 | 
					Multiple anonymous heads (which are useless anyway) are not supported: you
 | 
				
			||||||
would only see the latest head.
 | 
					would only see the latest head.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Closed branches are not supported; they are not shown and you can't close or
 | 
					Closed branches are not supported: they are not shown and you can't close or
 | 
				
			||||||
reopen. Additionally in certain rare situations a synchronization issue can
 | 
					reopen. Additionally in certain rare situations a synchronization issue can
 | 
				
			||||||
occur (https://github.com/felipec/git/issues/65[Bug #65]).
 | 
					occur (https://github.com/felipec/git/issues/65[Bug #65]).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -146,8 +162,6 @@ Limitations of the remote-helpers' framework apply. In particular, these
 | 
				
			|||||||
commands don't work:
 | 
					commands don't work:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
* `git push origin :branch-to-delete`
 | 
					* `git push origin :branch-to-delete`
 | 
				
			||||||
* `git push origin old:new` (it will push 'old') (patches available)
 | 
					 | 
				
			||||||
* `git push --dry-run origin branch` (it will push) (patches available)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
****
 | 
					****
 | 
				
			||||||
Another limitation is that if `git log` reports a rename, this will not survive
 | 
					Another limitation is that if `git log` reports a rename, this will not survive
 | 
				
			||||||
@@ -165,16 +179,27 @@ below for more details.
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
== Other projects ==
 | 
					== Other projects ==
 | 
				
			||||||
 | 
					
 | 
				
			||||||
There are other 'git-remote-hg' projects out there, do not confuse this one,
 | 
					There are other `git-remote-hg` projects out there, but this is the original,
 | 
				
			||||||
this is the one distributed officially by the Git project
 | 
					which was distributed officially in the Git project.
 | 
				
			||||||
(_though actually no longer so nowadays_):
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
* https://github.com/msysgit/msysgit/wiki/Guide-to-git-remote-hg[msysgit's git-remote-hg]
 | 
					Over the years many similar tools have died out, the only actively maintained
 | 
				
			||||||
* https://github.com/rfk/git-remote-hg[rfk's git-remote-hg]
 | 
					alternative is mnauw's fork of this project:
 | 
				
			||||||
 | 
					https://github.com/mnauw/git-remote-hg[mnauw/git-remote-hg]. I've merged some of
 | 
				
			||||||
 | 
					his patches, and he has merged some of my patches, so the projects are mostly in
 | 
				
			||||||
 | 
					sync, but not quite. In particular Nauwelaerts' fork has many administrative
 | 
				
			||||||
 | 
					extensions, which although useful to some people, I don't believe they belong
 | 
				
			||||||
 | 
					in the core.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
For a comparison between these and other projects go
 | 
					For a comparison between these and other projects go
 | 
				
			||||||
https://github.com/felipec/git/wiki/Comparison-of-git-remote-hg-alternatives[here].
 | 
					https://github.com/felipec/git/wiki/Comparison-of-git-remote-hg-alternatives[here].
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					****
 | 
				
			||||||
 | 
					mnauw's note; I do not know what "the core" means?
 | 
				
			||||||
 | 
					However, the "extensions" provide useful and possibly
 | 
				
			||||||
 | 
					critical maintenance wrt git-remote-hg's internal data, so it belongs as close
 | 
				
			||||||
 | 
					to the latter one as possible.
 | 
				
			||||||
 | 
					****
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[[no-limitations]]
 | 
					[[no-limitations]]
 | 
				
			||||||
== Limitations (or not) ==
 | 
					== Limitations (or not) ==
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -247,9 +272,11 @@ to fully complete the conversion (prior to subsequent pushing).
 | 
				
			|||||||
Some Mercurial names (of branches, bookmarks, tags) may not be a valid git
 | 
					Some Mercurial names (of branches, bookmarks, tags) may not be a valid git
 | 
				
			||||||
refname. See e.g. `man git-check-ref-format` for a rather involved set of rules.
 | 
					refname. See e.g. `man git-check-ref-format` for a rather involved set of rules.
 | 
				
			||||||
Moreover, while a slash `/` is allowed, it is not supported to have both a `parent`
 | 
					Moreover, while a slash `/` is allowed, it is not supported to have both a `parent`
 | 
				
			||||||
and `parent/child` branch (though only the latter is allowed). So, pending some
 | 
					and `parent/child` branch (though only the latter is allowed). Even though
 | 
				
			||||||
"nice" bidirectional encoding (not even e.g. URL encoding is safe actually), it is more
 | 
					it is not quite (bidirectionally) safe, a (percentage) URL encoding
 | 
				
			||||||
likely that only a few instances (out of a whole Mercurial repo) are
 | 
					(with some additional twist) is performed to obtain sane git refnames, at least
 | 
				
			||||||
 | 
					so for most cases.  If some nasty cases still slip through, then likely only
 | 
				
			||||||
 | 
					a few instances (out of a whole Mercurial repo) are
 | 
				
			||||||
problematic.  This could be handled by a single-branch clone and/or configuring
 | 
					problematic.  This could be handled by a single-branch clone and/or configuring
 | 
				
			||||||
a suitable refspec.  However, it might be more convenient to simply filter out a
 | 
					a suitable refspec.  However, it might be more convenient to simply filter out a
 | 
				
			||||||
few unimportant pesky cases, which can be done by configuring a regural
 | 
					few unimportant pesky cases, which can be done by configuring a regural
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -38,7 +38,8 @@ If you want to see Mercurial revisions as Git commit notes:
 | 
				
			|||||||
% git config core.notesRef refs/notes/hg
 | 
					% git config core.notesRef refs/notes/hg
 | 
				
			||||||
--------------------------------------
 | 
					--------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
If you are not interested in Mercurial permanent and global branches (aka. commit labels):
 | 
					If you are not interested in Mercurial permanent and global branches (aka.
 | 
				
			||||||
 | 
					commit labels):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--------------------------------------
 | 
					--------------------------------------
 | 
				
			||||||
% git config --global remote-hg.track-branches false
 | 
					% git config --global remote-hg.track-branches false
 | 
				
			||||||
@@ -52,7 +53,8 @@ If you want the equivalent of `hg clone --insecure`:
 | 
				
			|||||||
% git config --global remote-hg.insecure true
 | 
					% git config --global remote-hg.insecure true
 | 
				
			||||||
--------------------------------------
 | 
					--------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
If you want 'git-remote-hg' to be compatible with 'hg-git', and generate exactly the same commits:
 | 
					If you want 'git-remote-hg' to be compatible with 'hg-git', and generate exactly
 | 
				
			||||||
 | 
					the same commits:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--------------------------------------
 | 
					--------------------------------------
 | 
				
			||||||
% git config --global remote-hg.hg-git-compat true
 | 
					% git config --global remote-hg.hg-git-compat true
 | 
				
			||||||
@@ -105,16 +107,15 @@ the invalid '~'
 | 
				
			|||||||
NOTES
 | 
					NOTES
 | 
				
			||||||
-----
 | 
					-----
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Remember to run `git gc --aggressive` after cloning a repository, specially if
 | 
					Remember to run `git gc --aggressive` after cloning a repository, especially if
 | 
				
			||||||
it's a big one. Otherwise lots of space will be wasted.
 | 
					it's a big one. Otherwise lots of space will be wasted.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The oldest version of Mercurial supported is 1.9. For the most part 1.8 works,
 | 
					The newest supported version of Mercurial is 6.2, the oldest one is 2.4.
 | 
				
			||||||
but you might experience some issues.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
Pushing branches
 | 
					Pushing branches
 | 
				
			||||||
~~~~~~~~~~~~~~~~
 | 
					~~~~~~~~~~~~~~~~
 | 
				
			||||||
 | 
					
 | 
				
			||||||
To push a Mercurial named branch, you need to use the "branches/" prefix:
 | 
					To push a branch, you need to use the "branches/" prefix:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--------------------------------------
 | 
					--------------------------------------
 | 
				
			||||||
% git checkout branches/next
 | 
					% git checkout branches/next
 | 
				
			||||||
@@ -135,7 +136,7 @@ The simplest way is to specify the user and password in the URL:
 | 
				
			|||||||
git clone hg::https://user:password@bitbucket.org/user/repo
 | 
					git clone hg::https://user:password@bitbucket.org/user/repo
 | 
				
			||||||
--------------------------------------
 | 
					--------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
You can also use the http://mercurial.selenic.com/wiki/SchemesExtension[schemes extension]:
 | 
					You can also use the https://mercurial-scm.org/wiki/SchemesExtension[schemes extension]:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--------------------------------------
 | 
					--------------------------------------
 | 
				
			||||||
[auth]
 | 
					[auth]
 | 
				
			||||||
@@ -145,7 +146,7 @@ bb.password = password
 | 
				
			|||||||
--------------------------------------
 | 
					--------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Finally, you can also use the
 | 
					Finally, you can also use the
 | 
				
			||||||
https://pypi.python.org/pypi/mercurial_keyring[keyring extension].
 | 
					https://pypi.org/project/mercurial_keyring[keyring extension].
 | 
				
			||||||
 | 
					
 | 
				
			||||||
CAVEATS
 | 
					CAVEATS
 | 
				
			||||||
-------
 | 
					-------
 | 
				
			||||||
@@ -157,10 +158,10 @@ Mercurial branches and bookmarks have some limitations of Git branches: you
 | 
				
			|||||||
can't have both 'dev/feature' and 'dev' (as Git uses files and directories to
 | 
					can't have both 'dev/feature' and 'dev' (as Git uses files and directories to
 | 
				
			||||||
store them).
 | 
					store them).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Multiple anonymous heads (which are useless anyway) are not supported; you
 | 
					Multiple anonymous heads (which are useless anyway) are not supported: you
 | 
				
			||||||
would only see the latest head.
 | 
					would only see the latest head.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Closed branches are not supported; they are not shown and you can't close or
 | 
					Closed branches are not supported: they are not shown and you can't close or
 | 
				
			||||||
reopen. Additionally in certain rare situations a synchronization issue can
 | 
					reopen. Additionally in certain rare situations a synchronization issue can
 | 
				
			||||||
occur (https://github.com/felipec/git/issues/65[Bug #65]).
 | 
					occur (https://github.com/felipec/git/issues/65[Bug #65]).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										300
									
								
								git-hg-helper
									
									
									
									
									
								
							
							
						
						
									
										300
									
								
								git-hg-helper
									
									
									
									
									
								
							@@ -1,10 +1,15 @@
 | 
				
			|||||||
#!/usr/bin/env python2
 | 
					#!/usr/bin/env python
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Copyright (c) 2016 Mark Nauwelaerts
 | 
					# Copyright (c) 2016 Mark Nauwelaerts
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from mercurial import hg, ui, commands, util
 | 
					from mercurial import hg, ui, commands, util
 | 
				
			||||||
from mercurial import context, subrepo
 | 
					from mercurial import context, subrepo
 | 
				
			||||||
 | 
					try:
 | 
				
			||||||
 | 
					    # hg >= 5.8
 | 
				
			||||||
 | 
					    from mercurial.utils import urlutil
 | 
				
			||||||
 | 
					except ImportError:
 | 
				
			||||||
 | 
					    from mercurial import util as urlutil
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import re
 | 
					import re
 | 
				
			||||||
import sys
 | 
					import sys
 | 
				
			||||||
@@ -16,13 +21,72 @@ import logging
 | 
				
			|||||||
import threading
 | 
					import threading
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# thanks go to git-remote-helper for some helper functions
 | 
					# thanks go to git-remote-helper for some helper functions
 | 
				
			||||||
 | 
					# likewise so for python2/3 compatibility
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def die(msg, *args):
 | 
					# generic
 | 
				
			||||||
    sys.stderr.write('ERROR: %s\n' % (msg % args))
 | 
					class basecompat:
 | 
				
			||||||
 | 
					    @staticmethod
 | 
				
			||||||
 | 
					    def char(c):
 | 
				
			||||||
 | 
					      assert len(c) == 1
 | 
				
			||||||
 | 
					      return c[0]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if sys.version_info[0] == 3:
 | 
				
			||||||
 | 
					    import locale
 | 
				
			||||||
 | 
					    class compat(basecompat):
 | 
				
			||||||
 | 
					        # sigh ... wonderful python3 ... as taken from Mercurial's pycompat
 | 
				
			||||||
 | 
					        @staticmethod
 | 
				
			||||||
 | 
					        def decode_sysarg(arg):
 | 
				
			||||||
 | 
					            if os.name == r'nt':
 | 
				
			||||||
 | 
					                return arg.encode("mbcs", "ignore")
 | 
				
			||||||
 | 
					            else:
 | 
				
			||||||
 | 
					                enc = (
 | 
				
			||||||
 | 
					                    locale.getlocale()[1]
 | 
				
			||||||
 | 
					                    or locale.getdefaultlocale()[1]
 | 
				
			||||||
 | 
					                    or sys.getfilesystemencoding()
 | 
				
			||||||
 | 
					                )
 | 
				
			||||||
 | 
					                return arg.encode(enc, "surrogateescape")
 | 
				
			||||||
 | 
					        # mostly used for straight 'cast' (not real unicode content)
 | 
				
			||||||
 | 
					        @staticmethod
 | 
				
			||||||
 | 
					        def to_b(s, *args):
 | 
				
			||||||
 | 
					            if isinstance(s, str):
 | 
				
			||||||
 | 
					                args = args or ['latin-1']
 | 
				
			||||||
 | 
					                return s.encode(*args)
 | 
				
			||||||
 | 
					            return s
 | 
				
			||||||
 | 
					        stdin = sys.stdin.buffer
 | 
				
			||||||
 | 
					        stdout = sys.stdout.buffer
 | 
				
			||||||
 | 
					        stderr = sys.stderr.buffer
 | 
				
			||||||
 | 
					        getcwd = os.getcwdb
 | 
				
			||||||
 | 
					        @staticmethod
 | 
				
			||||||
 | 
					        def getenvb(val, default):
 | 
				
			||||||
 | 
					            result = os.getenv(val.decode(), default.decode() if hasattr(default, 'decode') else default)
 | 
				
			||||||
 | 
					             # if result is a string, get bytes instead
 | 
				
			||||||
 | 
					            result = result.encode() if hasattr(result, 'encode') else result
 | 
				
			||||||
 | 
					            return result
 | 
				
			||||||
 | 
					        getenv = os.getenvb if os.supports_bytes_environ else getenvb
 | 
				
			||||||
 | 
					else:
 | 
				
			||||||
 | 
					    class compat(basecompat):
 | 
				
			||||||
 | 
					        # life was simple in those days ...
 | 
				
			||||||
 | 
					        @staticmethod
 | 
				
			||||||
 | 
					        def to_b(s, *args):
 | 
				
			||||||
 | 
					            return s
 | 
				
			||||||
 | 
					        decode_sysarg = to_b
 | 
				
			||||||
 | 
					        stdin = sys.stdin
 | 
				
			||||||
 | 
					        stdout = sys.stdout
 | 
				
			||||||
 | 
					        stderr = sys.stderr
 | 
				
			||||||
 | 
					        getcwd = staticmethod(os.getcwd)
 | 
				
			||||||
 | 
					        getenv = staticmethod(os.getenv)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def puts(msg = b''):
 | 
				
			||||||
 | 
					    compat.stdout.write(msg)
 | 
				
			||||||
 | 
					    compat.stdout.write(b'\n')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def die(msg):
 | 
				
			||||||
 | 
					    compat.stderr.write(b'ERROR: %s\n' % compat.to_b(msg, 'utf-8'))
 | 
				
			||||||
    sys.exit(1)
 | 
					    sys.exit(1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def warn(msg, *args):
 | 
					def warn(msg):
 | 
				
			||||||
    sys.stderr.write('WARNING: %s\n' % (msg % args))
 | 
					    compat.stderr.write(b'WARNING: %s\n' % compat.to_b(msg, 'utf-8'))
 | 
				
			||||||
 | 
					    compat.stderr.flush()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def info(msg, *args):
 | 
					def info(msg, *args):
 | 
				
			||||||
    logger.info(msg, *args)
 | 
					    logger.info(msg, *args)
 | 
				
			||||||
@@ -44,7 +108,7 @@ class GitHgRepo:
 | 
				
			|||||||
    def __init__(self, topdir=None, gitdir=None):
 | 
					    def __init__(self, topdir=None, gitdir=None):
 | 
				
			||||||
        if gitdir != None:
 | 
					        if gitdir != None:
 | 
				
			||||||
            self.gitdir = gitdir
 | 
					            self.gitdir = gitdir
 | 
				
			||||||
            self.topdir = os.path.join(gitdir, '..') # will have to do
 | 
					            self.topdir = os.path.join(gitdir, b'..') # will have to do
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            self.topdir = None
 | 
					            self.topdir = None
 | 
				
			||||||
            if not topdir:
 | 
					            if not topdir:
 | 
				
			||||||
@@ -53,7 +117,7 @@ class GitHgRepo:
 | 
				
			|||||||
                    if not os.path.exists('.git'):
 | 
					                    if not os.path.exists('.git'):
 | 
				
			||||||
                        # now we lost where we are
 | 
					                        # now we lost where we are
 | 
				
			||||||
                        raise Exception('failed to determine topdir')
 | 
					                        raise Exception('failed to determine topdir')
 | 
				
			||||||
                    topdir = '.'
 | 
					                    topdir = b'.'
 | 
				
			||||||
            self.topdir = topdir
 | 
					            self.topdir = topdir
 | 
				
			||||||
            self.gitdir = self.run_cmd(['rev-parse', '--git-dir']).strip()
 | 
					            self.gitdir = self.run_cmd(['rev-parse', '--git-dir']).strip()
 | 
				
			||||||
            if not self.gitdir:
 | 
					            if not self.gitdir:
 | 
				
			||||||
@@ -64,7 +128,7 @@ class GitHgRepo:
 | 
				
			|||||||
        self.hg_repos = {}
 | 
					        self.hg_repos = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def identity(self):
 | 
					    def identity(self):
 | 
				
			||||||
        return '[%s|%s]' % (os.getcwd(), self.topdir)
 | 
					        return b'[%s|%s]' % (compat.getcwd(), self.topdir or b'')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def start_cmd(self, args, **kwargs):
 | 
					    def start_cmd(self, args, **kwargs):
 | 
				
			||||||
        cmd = ['git'] + args
 | 
					        cmd = ['git'] + args
 | 
				
			||||||
@@ -82,7 +146,7 @@ class GitHgRepo:
 | 
				
			|||||||
        process = self.start_cmd(args, **kwargs)
 | 
					        process = self.start_cmd(args, **kwargs)
 | 
				
			||||||
        output = process.communicate()[0]
 | 
					        output = process.communicate()[0]
 | 
				
			||||||
        if check and process.returncode != 0:
 | 
					        if check and process.returncode != 0:
 | 
				
			||||||
            die('command failed: %s', ' '.join(cmd))
 | 
					            die(b'command failed: %s' % b' '.join([compat.to_b(a) for a in cmd]))
 | 
				
			||||||
        return output
 | 
					        return output
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def get_config(self, config, getall=False):
 | 
					    def get_config(self, config, getall=False):
 | 
				
			||||||
@@ -91,17 +155,17 @@ class GitHgRepo:
 | 
				
			|||||||
        return self.run_cmd(['config', get[getall] , config], stderr=None)
 | 
					        return self.run_cmd(['config', get[getall] , config], stderr=None)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def get_config_bool(self, config, default=False):
 | 
					    def get_config_bool(self, config, default=False):
 | 
				
			||||||
        value = self.get_config(config).rstrip('\n')
 | 
					        value = self.get_config(config).rstrip()
 | 
				
			||||||
        if value == "true":
 | 
					        if value == b"true":
 | 
				
			||||||
            return True
 | 
					            return True
 | 
				
			||||||
        elif value == "false":
 | 
					        elif value == b"false":
 | 
				
			||||||
            return False
 | 
					            return False
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            return default
 | 
					            return default
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def get_hg_repo_url(self, remote):
 | 
					    def get_hg_repo_url(self, remote):
 | 
				
			||||||
        url = self.get_config('remote.%s.url' % (remote))
 | 
					        url = self.get_config(b'remote.%s.url' % (remote))
 | 
				
			||||||
        if url and url[0:4] == 'hg::':
 | 
					        if url and url[0:4] == b'hg::':
 | 
				
			||||||
            url = url[4:].strip()
 | 
					            url = url[4:].strip()
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            url = None
 | 
					            url = None
 | 
				
			||||||
@@ -129,9 +193,9 @@ class GitHgRepo:
 | 
				
			|||||||
        for r in self.get_hg_repos():
 | 
					        for r in self.get_hg_repos():
 | 
				
			||||||
            try:
 | 
					            try:
 | 
				
			||||||
                hgpath = remotehg.select_marks_dir(r, self.gitdir, False)
 | 
					                hgpath = remotehg.select_marks_dir(r, self.gitdir, False)
 | 
				
			||||||
                m = remotehg.Marks(os.path.join(hgpath, 'marks-hg'), None)
 | 
					                m = remotehg.Marks(os.path.join(hgpath, b'marks-hg'), None)
 | 
				
			||||||
                mark = m.from_rev(rev)
 | 
					                mark = m.from_rev(rev)
 | 
				
			||||||
                m = GitMarks(os.path.join(hgpath, 'marks-git'))
 | 
					                m = GitMarks(os.path.join(hgpath, b'marks-git'))
 | 
				
			||||||
                return m.to_rev(mark)
 | 
					                return m.to_rev(mark)
 | 
				
			||||||
            except:
 | 
					            except:
 | 
				
			||||||
                pass
 | 
					                pass
 | 
				
			||||||
@@ -143,28 +207,28 @@ class GitHgRepo:
 | 
				
			|||||||
            return self.hg_repos
 | 
					            return self.hg_repos
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # check any local hg repo to see if rev is in there
 | 
					        # check any local hg repo to see if rev is in there
 | 
				
			||||||
        shared_path = os.path.join(self.gitdir, 'hg')
 | 
					        shared_path = os.path.join(self.gitdir, b'hg')
 | 
				
			||||||
        hg_path = os.path.join(shared_path, '.hg')
 | 
					        hg_path = os.path.join(shared_path, b'.hg')
 | 
				
			||||||
        if os.path.exists(shared_path):
 | 
					        if os.path.exists(shared_path):
 | 
				
			||||||
            repos = os.listdir(shared_path)
 | 
					            repos = os.listdir(shared_path)
 | 
				
			||||||
            for r in repos:
 | 
					            for r in repos:
 | 
				
			||||||
                # skip the shared repo
 | 
					                # skip the shared repo
 | 
				
			||||||
                if r == '.hg':
 | 
					                if r == b'.hg':
 | 
				
			||||||
                    continue
 | 
					                    continue
 | 
				
			||||||
                # only dirs
 | 
					                # only dirs
 | 
				
			||||||
                if not os.path.isdir(os.path.join(shared_path, r)):
 | 
					                if not os.path.isdir(os.path.join(shared_path, r)):
 | 
				
			||||||
                    continue
 | 
					                    continue
 | 
				
			||||||
                local_path = os.path.join(shared_path, r, 'clone')
 | 
					                local_path = os.path.join(shared_path, r, b'clone')
 | 
				
			||||||
                local_hg = os.path.join(local_path, '.hg')
 | 
					                local_hg = os.path.join(local_path, b'.hg')
 | 
				
			||||||
                if not os.path.exists(local_hg):
 | 
					                if not os.path.exists(local_hg):
 | 
				
			||||||
                    # could be a local repo without proxy, fetch url
 | 
					                    # could be a local repo without proxy, fetch url
 | 
				
			||||||
                    local_path = self.get_hg_repo_url(r)
 | 
					                    local_path = self.get_hg_repo_url(r)
 | 
				
			||||||
                    if not local_path:
 | 
					                    if not local_path:
 | 
				
			||||||
                        warn('failed to find local hg for remote %s', r)
 | 
					                        warn(b'failed to find local hg for remote %s' % (r))
 | 
				
			||||||
                        continue
 | 
					                        continue
 | 
				
			||||||
                else:
 | 
					                else:
 | 
				
			||||||
                    # make sure the shared path is always up-to-date
 | 
					                    # make sure the shared path is always up-to-date
 | 
				
			||||||
                    util.writefile(os.path.join(local_hg, 'sharedpath'),
 | 
					                    util.writefile(os.path.join(local_hg, b'sharedpath'),
 | 
				
			||||||
                        os.path.abspath(hg_path))
 | 
					                        os.path.abspath(hg_path))
 | 
				
			||||||
                self.hg_repos[r] = os.path.join(local_path)
 | 
					                self.hg_repos[r] = os.path.join(local_path)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -176,9 +240,9 @@ class GitHgRepo:
 | 
				
			|||||||
        repos = self.get_hg_repos()
 | 
					        repos = self.get_hg_repos()
 | 
				
			||||||
        if r in repos:
 | 
					        if r in repos:
 | 
				
			||||||
            local_path = repos[r]
 | 
					            local_path = repos[r]
 | 
				
			||||||
            hushui = ui.ui()
 | 
					            hushui = ui.ui.load() if hasattr(ui.ui, 'load') else ui.ui()
 | 
				
			||||||
            hushui.setconfig('ui', 'interactive', 'off')
 | 
					            hushui.setconfig(b'ui', b'interactive', b'off')
 | 
				
			||||||
            hushui.fout = open(os.devnull, 'w')
 | 
					            hushui.fout = open(os.devnull, 'wb')
 | 
				
			||||||
            return hg.repository(hushui, local_path)
 | 
					            return hg.repository(hushui, local_path)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def find_hg_repo(self, rev):
 | 
					    def find_hg_repo(self, rev):
 | 
				
			||||||
@@ -201,7 +265,7 @@ class GitHgRepo:
 | 
				
			|||||||
        def __init__(self, repo, files):
 | 
					        def __init__(self, repo, files):
 | 
				
			||||||
            p1, p2, data = repo[None], '0' * 40, ''
 | 
					            p1, p2, data = repo[None], '0' * 40, ''
 | 
				
			||||||
            context.memctx.__init__(self, repo, (p1, p2),
 | 
					            context.memctx.__init__(self, repo, (p1, p2),
 | 
				
			||||||
                data, files.keys(), self.getfilectx)
 | 
					                data, list(files.keys()), self.getfilectx)
 | 
				
			||||||
            self.files = files
 | 
					            self.files = files
 | 
				
			||||||
            self.remotehg = import_sibling('remotehg', 'git-remote-hg')
 | 
					            self.remotehg = import_sibling('remotehg', 'git-remote-hg')
 | 
				
			||||||
            self.remotehg.hg_version = hg_version
 | 
					            self.remotehg.hg_version = hg_version
 | 
				
			||||||
@@ -215,13 +279,13 @@ class GitHgRepo:
 | 
				
			|||||||
                is_link, is_exec, rename)
 | 
					                is_link, is_exec, rename)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def read(self, relpath, rev=None):
 | 
					    def read(self, relpath, rev=None):
 | 
				
			||||||
        rev = rev if rev else ':0'
 | 
					        rev = rev if rev else b':0'
 | 
				
			||||||
        obj = '%s:%s' % (rev, relpath)
 | 
					        obj = b'%s:%s' % (rev, relpath)
 | 
				
			||||||
        # might complain bitterly to stderr if no subrepos so let's not show that
 | 
					        # might complain bitterly to stderr if no subrepos so let's not show that
 | 
				
			||||||
        return self.run_cmd(['show', obj])
 | 
					        return self.run_cmd(['show', obj])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # see also subrepo.state
 | 
					    # see also subrepo.state
 | 
				
			||||||
    def state(self, remote='origin', rev=None):
 | 
					    def state(self, remote=b'origin', rev=None):
 | 
				
			||||||
        """return a state dict, mapping subrepo paths configured in .hgsub
 | 
					        """return a state dict, mapping subrepo paths configured in .hgsub
 | 
				
			||||||
        to tuple: (source from .hgsub, revision from .hgsubstate, kind
 | 
					        to tuple: (source from .hgsub, revision from .hgsubstate, kind
 | 
				
			||||||
        (key in types dict))
 | 
					        (key in types dict))
 | 
				
			||||||
@@ -229,7 +293,7 @@ class GitHgRepo:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        # obtain relevant files' content from specified revision
 | 
					        # obtain relevant files' content from specified revision
 | 
				
			||||||
        files = { }
 | 
					        files = { }
 | 
				
			||||||
        for f in ('.hgsub', '.hgsubstate'):
 | 
					        for f in (b'.hgsub', b'.hgsubstate'):
 | 
				
			||||||
            files[f] = self.read(f)
 | 
					            files[f] = self.read(f)
 | 
				
			||||||
        log('state files for %s in revision %s:\n%s', remote, rev, files)
 | 
					        log('state files for %s in revision %s:\n%s', remote, rev, files)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -237,7 +301,7 @@ class GitHgRepo:
 | 
				
			|||||||
        # (rather than duplicating the admittedly simple parsing here)
 | 
					        # (rather than duplicating the admittedly simple parsing here)
 | 
				
			||||||
        repo = self.get_hg_repo(remote)
 | 
					        repo = self.get_hg_repo(remote)
 | 
				
			||||||
        if not repo:
 | 
					        if not repo:
 | 
				
			||||||
            die('no hg repo for alias %s' % remote)
 | 
					            die(b'no hg repo for alias %s' % remote)
 | 
				
			||||||
        ctx = self.dictmemctx(repo, files)
 | 
					        ctx = self.dictmemctx(repo, files)
 | 
				
			||||||
        # helpers moved around 4.6
 | 
					        # helpers moved around 4.6
 | 
				
			||||||
        if hasattr(subrepo, 'state'):
 | 
					        if hasattr(subrepo, 'state'):
 | 
				
			||||||
@@ -252,21 +316,21 @@ class GitHgRepo:
 | 
				
			|||||||
        resolved = {}
 | 
					        resolved = {}
 | 
				
			||||||
        for s in state:
 | 
					        for s in state:
 | 
				
			||||||
            src, rev, kind = state[s]
 | 
					            src, rev, kind = state[s]
 | 
				
			||||||
            if not kind in ('hg', 'git'):
 | 
					            if not kind in (b'hg', b'git'):
 | 
				
			||||||
                warn('skipping unsupported subrepo type %s' % kind)
 | 
					                warn('skipping unsupported subrepo type %s' % kind)
 | 
				
			||||||
                continue
 | 
					                continue
 | 
				
			||||||
            if not util.url(src).isabs():
 | 
					            if not urlutil.url(src).isabs():
 | 
				
			||||||
                parent = self.get_hg_repo_url(remote)
 | 
					                parent = self.get_hg_repo_url(remote)
 | 
				
			||||||
                if not parent:
 | 
					                if not parent:
 | 
				
			||||||
                    die('could not determine repo url of %s' % remote)
 | 
					                    die(b'could not determine repo url of %s' % remote)
 | 
				
			||||||
                parent = util.url(parent)
 | 
					                parent = urlutil.url(parent)
 | 
				
			||||||
                parent.path = posixpath.join(parent.path or '', src)
 | 
					                parent.path = posixpath.join(parent.path or b'', src)
 | 
				
			||||||
                parent.path = posixpath.normpath(parent.path)
 | 
					                parent.path = posixpath.normpath(parent.path)
 | 
				
			||||||
                src = str(parent)
 | 
					                src = bytes(parent)
 | 
				
			||||||
            # translate to git view url
 | 
					            # translate to git view url
 | 
				
			||||||
            if kind == 'hg':
 | 
					            if kind == b'hg':
 | 
				
			||||||
                src = 'hg::' + src
 | 
					                src = b'hg::' + src
 | 
				
			||||||
            resolved[s] = (src.strip(), rev or '', kind)
 | 
					            resolved[s] = (src.strip(), rev or b'', kind)
 | 
				
			||||||
        log('resolved state %s', resolved)
 | 
					        log('resolved state %s', resolved)
 | 
				
			||||||
        return resolved
 | 
					        return resolved
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -277,12 +341,15 @@ class SubCommand:
 | 
				
			|||||||
        self.subcommand = subcmdname
 | 
					        self.subcommand = subcmdname
 | 
				
			||||||
        self.githgrepo = githgrepo
 | 
					        self.githgrepo = githgrepo
 | 
				
			||||||
        self.argparser = self.argumentparser()
 | 
					        self.argparser = self.argumentparser()
 | 
				
			||||||
 | 
					        # list of str
 | 
				
			||||||
 | 
					        self.args = []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def argumentparser(self):
 | 
					    def argumentparser(self):
 | 
				
			||||||
        return argparse.ArgumentParser()
 | 
					        return argparse.ArgumentParser()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def get_remote(self, args):
 | 
					    def get_remote(self, args):
 | 
				
			||||||
        if len(args):
 | 
					        if len(args):
 | 
				
			||||||
 | 
					            assert isinstance(args[0], bytes)
 | 
				
			||||||
            return (args[0], args[1:])
 | 
					            return (args[0], args[1:])
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            self.usage('missing argument: <remote-alias>')
 | 
					            self.usage('missing argument: <remote-alias>')
 | 
				
			||||||
@@ -295,7 +362,7 @@ class SubCommand:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    def execute(self, args):
 | 
					    def execute(self, args):
 | 
				
			||||||
        (self.options, self.args) = self.argparser.parse_known_args(args)
 | 
					        (self.options, self.args) = self.argparser.parse_known_args(args)
 | 
				
			||||||
        self.do(self.options, self.args)
 | 
					        self.do(self.options, [compat.decode_sysarg(a) for a in self.args])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def usage(self, msg):
 | 
					    def usage(self, msg):
 | 
				
			||||||
        if msg:
 | 
					        if msg:
 | 
				
			||||||
@@ -304,6 +371,7 @@ class SubCommand:
 | 
				
			|||||||
            self.argparser.print_usage(sys.stderr)
 | 
					            self.argparser.print_usage(sys.stderr)
 | 
				
			||||||
            sys.exit(2)
 | 
					            sys.exit(2)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # args: list of bytes
 | 
				
			||||||
    def do(self, options, args):
 | 
					    def do(self, options, args):
 | 
				
			||||||
        pass
 | 
					        pass
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -322,7 +390,7 @@ class HgRevCommand(SubCommand):
 | 
				
			|||||||
        if len(args):
 | 
					        if len(args):
 | 
				
			||||||
            hgrev = self.githgrepo.get_hg_rev(args[0])
 | 
					            hgrev = self.githgrepo.get_hg_rev(args[0])
 | 
				
			||||||
            if hgrev:
 | 
					            if hgrev:
 | 
				
			||||||
                print hgrev
 | 
					                puts(hgrev)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class GitMarks:
 | 
					class GitMarks:
 | 
				
			||||||
@@ -340,24 +408,24 @@ class GitMarks:
 | 
				
			|||||||
        if not os.path.exists(self.path):
 | 
					        if not os.path.exists(self.path):
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for l in file(self.path):
 | 
					        for l in open(self.path, 'rb'):
 | 
				
			||||||
            m, c = l.strip().split(' ', 2)
 | 
					            m, c = l.strip().split(b' ', 2)
 | 
				
			||||||
            m = int(m[1:])
 | 
					            m = int(m[1:])
 | 
				
			||||||
            self.marks[c] = m
 | 
					            self.marks[c] = m
 | 
				
			||||||
            self.rev_marks[m] = c
 | 
					            self.rev_marks[m] = c
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def store(self):
 | 
					    def store(self):
 | 
				
			||||||
        marks = self.rev_marks.keys()
 | 
					        marks = list(self.rev_marks.keys())
 | 
				
			||||||
        marks.sort()
 | 
					        marks.sort()
 | 
				
			||||||
        with open(self.path, 'w') as f:
 | 
					        with open(self.path, 'wb') as f:
 | 
				
			||||||
            for m in marks:
 | 
					            for m in marks:
 | 
				
			||||||
                f.write(':%d %s\n' % (m, self.rev_marks[m]))
 | 
					                f.write(b':%d %s\n' % (m, self.rev_marks[m]))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def from_rev(self, rev):
 | 
					    def from_rev(self, rev):
 | 
				
			||||||
        return self.marks[rev]
 | 
					        return self.marks[rev]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def to_rev(self, mark):
 | 
					    def to_rev(self, mark):
 | 
				
			||||||
        return str(self.rev_marks[mark])
 | 
					        return self.rev_marks[mark]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class GitRevCommand(SubCommand):
 | 
					class GitRevCommand(SubCommand):
 | 
				
			||||||
@@ -375,7 +443,7 @@ class GitRevCommand(SubCommand):
 | 
				
			|||||||
            rev = args[0]
 | 
					            rev = args[0]
 | 
				
			||||||
            gitcommit = self.githgrepo.get_git_commit(rev)
 | 
					            gitcommit = self.githgrepo.get_git_commit(rev)
 | 
				
			||||||
            if gitcommit:
 | 
					            if gitcommit:
 | 
				
			||||||
                print gitcommit
 | 
					                puts(gitcommit)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class GcCommand(SubCommand):
 | 
					class GcCommand(SubCommand):
 | 
				
			||||||
@@ -408,7 +476,7 @@ class GcCommand(SubCommand):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    def print_commits(self, gm, dest):
 | 
					    def print_commits(self, gm, dest):
 | 
				
			||||||
        for c in gm.marks.keys():
 | 
					        for c in gm.marks.keys():
 | 
				
			||||||
            dest.write(c + '\n')
 | 
					            dest.write(c + b'\n')
 | 
				
			||||||
        dest.flush()
 | 
					        dest.flush()
 | 
				
			||||||
        dest.close()
 | 
					        dest.close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -422,27 +490,27 @@ class GcCommand(SubCommand):
 | 
				
			|||||||
            if not remote in hg_repos:
 | 
					            if not remote in hg_repos:
 | 
				
			||||||
                self.usage('%s is not a valid hg remote' % (remote))
 | 
					                self.usage('%s is not a valid hg remote' % (remote))
 | 
				
			||||||
            hgpath = remotehg.select_marks_dir(remote, self.githgrepo.gitdir, False)
 | 
					            hgpath = remotehg.select_marks_dir(remote, self.githgrepo.gitdir, False)
 | 
				
			||||||
            print "Loading hg marks ..."
 | 
					            puts(b"Loading hg marks ...")
 | 
				
			||||||
            hgm = remotehg.Marks(os.path.join(hgpath, 'marks-hg'), None)
 | 
					            hgm = remotehg.Marks(os.path.join(hgpath, b'marks-hg'), None)
 | 
				
			||||||
            print "Loading git marks ..."
 | 
					            puts(b"Loading git marks ...")
 | 
				
			||||||
            gm = GitMarks(os.path.join(hgpath, 'marks-git'))
 | 
					            gm = GitMarks(os.path.join(hgpath, b'marks-git'))
 | 
				
			||||||
            repo = hg.repository(ui.ui(), hg_repos[remote]) if options.check_hg else None
 | 
					            repo = hg.repository(ui.ui(), hg_repos[remote]) if options.check_hg else None
 | 
				
			||||||
            # git-gc may have dropped unreachable commits
 | 
					            # git-gc may have dropped unreachable commits
 | 
				
			||||||
            # (in particular due to multiple hg head cases)
 | 
					            # (in particular due to multiple hg head cases)
 | 
				
			||||||
            # need to drop those so git-fast-export or git-fast-import does not complain
 | 
					            # need to drop those so git-fast-export or git-fast-import does not complain
 | 
				
			||||||
            print "Performing garbage collection on git commits ..."
 | 
					            puts(b"Performing garbage collection on git commits ...")
 | 
				
			||||||
            process = self.githgrepo.start_cmd(['cat-file', '--batch-check'], \
 | 
					            process = self.githgrepo.start_cmd(['cat-file', '--batch-check'], \
 | 
				
			||||||
                stdin=subprocess.PIPE)
 | 
					                stdin=subprocess.PIPE)
 | 
				
			||||||
            thread = threading.Thread(target=self.print_commits, args=(gm, process.stdin))
 | 
					            thread = threading.Thread(target=self.print_commits, args=(gm, process.stdin))
 | 
				
			||||||
            thread.start()
 | 
					            thread.start()
 | 
				
			||||||
            git_marks = set({})
 | 
					            git_marks = set({})
 | 
				
			||||||
            for l in process.stdout:
 | 
					            for l in process.stdout:
 | 
				
			||||||
                sp = l.strip().split(' ', 2)
 | 
					                sp = l.strip().split(b' ', 2)
 | 
				
			||||||
                if sp[1] == 'commit':
 | 
					                if sp[1] == 'commit':
 | 
				
			||||||
                    git_marks.add(gm.from_rev(sp[0]))
 | 
					                    git_marks.add(gm.from_rev(sp[0]))
 | 
				
			||||||
            thread.join()
 | 
					            thread.join()
 | 
				
			||||||
            # reduce down to marks that are common to both
 | 
					            # reduce down to marks that are common to both
 | 
				
			||||||
            print "Computing marks intersection ..."
 | 
					            puts(b"Computing marks intersection ...")
 | 
				
			||||||
            common_marks = set(hgm.rev_marks.keys()).intersection(git_marks)
 | 
					            common_marks = set(hgm.rev_marks.keys()).intersection(git_marks)
 | 
				
			||||||
            hg_rev_marks = {}
 | 
					            hg_rev_marks = {}
 | 
				
			||||||
            git_rev_marks = {}
 | 
					            git_rev_marks = {}
 | 
				
			||||||
@@ -453,7 +521,7 @@ class GcCommand(SubCommand):
 | 
				
			|||||||
                git_rev_marks[m] = gm.rev_marks[m]
 | 
					                git_rev_marks[m] = gm.rev_marks[m]
 | 
				
			||||||
            # common marks will not not include any refs/notes/hg
 | 
					            # common marks will not not include any refs/notes/hg
 | 
				
			||||||
            # let's not discard those casually, though they are not vital
 | 
					            # let's not discard those casually, though they are not vital
 | 
				
			||||||
            print "Including notes commits ..."
 | 
					            puts(b"Including notes commits ...")
 | 
				
			||||||
            revlist = self.githgrepo.start_cmd(['rev-list', 'refs/notes/hg'])
 | 
					            revlist = self.githgrepo.start_cmd(['rev-list', 'refs/notes/hg'])
 | 
				
			||||||
            for l in revlist.stdout.readlines():
 | 
					            for l in revlist.stdout.readlines():
 | 
				
			||||||
                c = l.strip()
 | 
					                c = l.strip()
 | 
				
			||||||
@@ -465,24 +533,24 @@ class GcCommand(SubCommand):
 | 
				
			|||||||
                git_rev_marks[hgm.last_note] = gm.rev_marks[hgm.last_note]
 | 
					                git_rev_marks[hgm.last_note] = gm.rev_marks[hgm.last_note]
 | 
				
			||||||
            # some status report
 | 
					            # some status report
 | 
				
			||||||
            if len(hgm.rev_marks) != len(hg_rev_marks):
 | 
					            if len(hgm.rev_marks) != len(hg_rev_marks):
 | 
				
			||||||
                print "Trimmed hg marks from #%d down to #%d" % (len(hgm.rev_marks), len(hg_rev_marks))
 | 
					                puts(b"Trimmed hg marks from #%d down to #%d" % (len(hgm.rev_marks), len(hg_rev_marks)))
 | 
				
			||||||
            if len(gm.rev_marks) != len(git_rev_marks):
 | 
					            if len(gm.rev_marks) != len(git_rev_marks):
 | 
				
			||||||
                print "Trimmed git marks from #%d down to #%d" % (len(gm.rev_marks), len(git_rev_marks))
 | 
					                puts(b"Trimmed git marks from #%d down to #%d" % (len(gm.rev_marks), len(git_rev_marks)))
 | 
				
			||||||
            # marks-hg tips irrelevant nowadays
 | 
					            # marks-hg tips irrelevant nowadays
 | 
				
			||||||
            # now update and store
 | 
					            # now update and store
 | 
				
			||||||
            if not options.dry_run:
 | 
					            if not options.dry_run:
 | 
				
			||||||
                # hg marks
 | 
					                # hg marks
 | 
				
			||||||
                print "Writing hg marks ..."
 | 
					                puts(b"Writing hg marks ...")
 | 
				
			||||||
                hgm.rev_marks = hg_rev_marks
 | 
					                hgm.rev_marks = hg_rev_marks
 | 
				
			||||||
                hgm.marks = {}
 | 
					                hgm.marks = {}
 | 
				
			||||||
                for mark, rev in hg_rev_marks.iteritems():
 | 
					                for mark, rev in hg_rev_marks.items():
 | 
				
			||||||
                    hgm.marks[rev] = mark
 | 
					                    hgm.marks[rev] = mark
 | 
				
			||||||
                hgm.store()
 | 
					                hgm.store()
 | 
				
			||||||
                # git marks
 | 
					                # git marks
 | 
				
			||||||
                print "Writing git marks ..."
 | 
					                puts(b"Writing git marks ...")
 | 
				
			||||||
                gm.rev_marks = git_rev_marks
 | 
					                gm.rev_marks = git_rev_marks
 | 
				
			||||||
                gm.marks = {}
 | 
					                gm.marks = {}
 | 
				
			||||||
                for mark, rev in git_rev_marks.iteritems():
 | 
					                for mark, rev in git_rev_marks.items():
 | 
				
			||||||
                    gm.marks[rev] = mark
 | 
					                    gm.marks[rev] = mark
 | 
				
			||||||
                gm.store()
 | 
					                gm.store()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -491,9 +559,9 @@ class SubRepoCommand(SubCommand):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    def writestate(repo, state):
 | 
					    def writestate(repo, state):
 | 
				
			||||||
        """rewrite .hgsubstate in (outer) repo with these subrepo states"""
 | 
					        """rewrite .hgsubstate in (outer) repo with these subrepo states"""
 | 
				
			||||||
        lines = ['%s %s\n' % (state[s][1], s) for s in sorted(state)
 | 
					        lines = [b'%s %s\n' % (state[s][1], s) for s in sorted(state)
 | 
				
			||||||
                                                    if state[s][1] != nullstate[1]]
 | 
					                                                    if state[s][1] != nullstate[1]]
 | 
				
			||||||
        repo.wwrite('.hgsubstate', ''.join(lines), '')
 | 
					        repo.wwrite(b'.hgsubstate', b''.join(lines), b'')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def argumentparser(self):
 | 
					    def argumentparser(self):
 | 
				
			||||||
        #usage = '%%(prog)s %s [options] <remote>...' % (self.subcommand)
 | 
					        #usage = '%%(prog)s %s [options] <remote>...' % (self.subcommand)
 | 
				
			||||||
@@ -630,7 +698,8 @@ class SubRepoCommand(SubCommand):
 | 
				
			|||||||
        if args:
 | 
					        if args:
 | 
				
			||||||
            # all arguments are registered, so should not have leftover
 | 
					            # all arguments are registered, so should not have leftover
 | 
				
			||||||
            # could be that main arguments were given to subcommands
 | 
					            # could be that main arguments were given to subcommands
 | 
				
			||||||
            warn('unparsed arguments: %s' % ' '.join(args))
 | 
					            warn(b'unparsed arguments: %s' % b' '.join(args))
 | 
				
			||||||
 | 
					        options.remote = compat.decode_sysarg(options.remote)
 | 
				
			||||||
        log('running subcmd options %s, args %s', options, args)
 | 
					        log('running subcmd options %s, args %s', options, args)
 | 
				
			||||||
        # establish initial operation ctx
 | 
					        # establish initial operation ctx
 | 
				
			||||||
        ctx = self.subcontext(self.githgrepo)
 | 
					        ctx = self.subcontext(self.githgrepo)
 | 
				
			||||||
@@ -640,10 +709,10 @@ class SubRepoCommand(SubCommand):
 | 
				
			|||||||
        log('running %s with options %s in context %s', \
 | 
					        log('running %s with options %s in context %s', \
 | 
				
			||||||
            options.func, options, ctx)
 | 
					            options.func, options, ctx)
 | 
				
			||||||
        subrepos = ctx.repo.state(options.remote)
 | 
					        subrepos = ctx.repo.state(options.remote)
 | 
				
			||||||
        paths = subrepos.keys()
 | 
					        paths = list(subrepos.keys())
 | 
				
			||||||
        selabspaths = None
 | 
					        selabspaths = None
 | 
				
			||||||
        if ctx.level == 0 and hasattr(options, 'paths') and options.paths:
 | 
					        if ctx.level == 0 and hasattr(options, 'paths') and options.paths:
 | 
				
			||||||
            selabspaths = [ os.path.abspath(p) for p in options.paths ]
 | 
					            selabspaths = [ os.path.abspath(compat.decode_sysarg(p)) for p in options.paths ]
 | 
				
			||||||
        log('level %s selected paths %s', ctx.level, selabspaths)
 | 
					        log('level %s selected paths %s', ctx.level, selabspaths)
 | 
				
			||||||
        for p in paths:
 | 
					        for p in paths:
 | 
				
			||||||
            # prep context
 | 
					            # prep context
 | 
				
			||||||
@@ -662,17 +731,17 @@ class SubRepoCommand(SubCommand):
 | 
				
			|||||||
            if not ctx.subrepo:
 | 
					            if not ctx.subrepo:
 | 
				
			||||||
                ctx.subrepo = self.git_hg_repo_try(ctx.subpath)
 | 
					                ctx.subrepo = self.git_hg_repo_try(ctx.subpath)
 | 
				
			||||||
            # prep recursion (only into git-hg subrepos)
 | 
					            # prep recursion (only into git-hg subrepos)
 | 
				
			||||||
            if ctx.subrepo and options.recursive and ctx.state[2] == 'hg':
 | 
					            if ctx.subrepo and options.recursive and ctx.state[2] == b'hg':
 | 
				
			||||||
                newctx = self.subcontext(ctx.subrepo)
 | 
					                newctx = self.subcontext(ctx.subrepo)
 | 
				
			||||||
                newctx.level = ctx.level + 1
 | 
					                newctx.level = ctx.level + 1
 | 
				
			||||||
                self.do_operation(options, args, newctx)
 | 
					                self.do_operation(options, args, newctx)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def get_git_commit(self, ctx):
 | 
					    def get_git_commit(self, ctx):
 | 
				
			||||||
        src, rev, kind = ctx.state
 | 
					        src, rev, kind = ctx.state
 | 
				
			||||||
        if kind == 'hg':
 | 
					        if kind == b'hg':
 | 
				
			||||||
            gitcommit = ctx.subrepo.get_git_commit(rev)
 | 
					            gitcommit = ctx.subrepo.get_git_commit(rev)
 | 
				
			||||||
            if not gitcommit:
 | 
					            if not gitcommit:
 | 
				
			||||||
                die('could not determine git commit for %s; a fetch may update notes' % rev)
 | 
					                die(b'could not determine git commit for %s; a fetch may update notes' % rev)
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            gitcommit = rev
 | 
					            gitcommit = rev
 | 
				
			||||||
        return gitcommit
 | 
					        return gitcommit
 | 
				
			||||||
@@ -681,28 +750,28 @@ class SubRepoCommand(SubCommand):
 | 
				
			|||||||
        if not ctx.subrepo:
 | 
					        if not ctx.subrepo:
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
        src, orig, kind = ctx.state
 | 
					        src, orig, kind = ctx.state
 | 
				
			||||||
        gitcommit = ctx.subrepo.rev_parse('HEAD')
 | 
					        gitcommit = ctx.subrepo.rev_parse(b'HEAD')
 | 
				
			||||||
        if not gitcommit:
 | 
					        if not gitcommit:
 | 
				
			||||||
            die('could not determine current HEAD state in %s' % ctx.subrepo.topdir)
 | 
					            die(b'could not determine current HEAD state in %s' % ctx.subrepo.topdir)
 | 
				
			||||||
        rev = gitcommit
 | 
					        rev = gitcommit
 | 
				
			||||||
        if kind == 'hg':
 | 
					        if kind == b'hg':
 | 
				
			||||||
            rev = ctx.subrepo.get_hg_rev(gitcommit)
 | 
					            rev = ctx.subrepo.get_hg_rev(gitcommit)
 | 
				
			||||||
            if not rev:
 | 
					            if not rev:
 | 
				
			||||||
                die('could not determine hg changeset for commit %s' % gitcommit)
 | 
					                die(b'could not determine hg changeset for commit %s' % gitcommit)
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            rev = gitcommit
 | 
					            rev = gitcommit
 | 
				
			||||||
        # obtain state from index
 | 
					        # obtain state from index
 | 
				
			||||||
        state_path = os.path.join(ctx.repo.topdir, '.hgsubstate')
 | 
					        state_path = os.path.join(ctx.repo.topdir, b'.hgsubstate')
 | 
				
			||||||
        # should have this, since we have subrepo (state) in the first place ...
 | 
					        # should have this, since we have subrepo (state) in the first place ...
 | 
				
			||||||
        if not os.path.exists(state_path):
 | 
					        if not os.path.exists(state_path):
 | 
				
			||||||
            die('no .hgsubstate found in repo %s' % ctx.repo.topdir)
 | 
					            die(b'no .hgsubstate found in repo %s' % ctx.repo.topdir)
 | 
				
			||||||
        if orig != rev:
 | 
					        if orig != rev:
 | 
				
			||||||
            short = ctx.subrepo.rev_parse(['--short', gitcommit])
 | 
					            short = ctx.subrepo.rev_parse(['--short', gitcommit])
 | 
				
			||||||
            print "Updating %s to %s [git %s]" % (ctx.subpath, rev, short)
 | 
					            puts(b"Updating %s to %s [git %s]" % (ctx.subpath, rev, short))
 | 
				
			||||||
            # replace and update index
 | 
					            # replace and update index
 | 
				
			||||||
            with open(state_path, 'r') as f:
 | 
					            with open(state_path, 'rb') as f:
 | 
				
			||||||
                state = f.read()
 | 
					                state = f.read()
 | 
				
			||||||
            state = re.sub('.{40} %s' % (ctx.relpath), '%s %s' % (rev, ctx.relpath), state)
 | 
					            state = re.sub(b'.{40} %s' % (ctx.relpath), b'%s %s' % (rev, ctx.relpath), state)
 | 
				
			||||||
            with open(state_path, 'wb') as f:
 | 
					            with open(state_path, 'wb') as f:
 | 
				
			||||||
                f.write(state)
 | 
					                f.write(state)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -710,7 +779,7 @@ class SubRepoCommand(SubCommand):
 | 
				
			|||||||
        if not ctx.subrepo:
 | 
					        if not ctx.subrepo:
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
        if not options.quiet:
 | 
					        if not options.quiet:
 | 
				
			||||||
            print 'Entering %s' % ctx.subpath
 | 
					            puts(b'Entering %s' % ctx.subpath)
 | 
				
			||||||
            sys.stdout.flush()
 | 
					            sys.stdout.flush()
 | 
				
			||||||
        newenv = os.environ.copy()
 | 
					        newenv = os.environ.copy()
 | 
				
			||||||
        newenv['path'] = ctx.relpath
 | 
					        newenv['path'] = ctx.relpath
 | 
				
			||||||
@@ -721,7 +790,7 @@ class SubRepoCommand(SubCommand):
 | 
				
			|||||||
        proc = subprocess.Popen(options.command, shell=True, cwd=ctx.subpath, env=newenv)
 | 
					        proc = subprocess.Popen(options.command, shell=True, cwd=ctx.subpath, env=newenv)
 | 
				
			||||||
        proc.wait()
 | 
					        proc.wait()
 | 
				
			||||||
        if proc.returncode != 0:
 | 
					        if proc.returncode != 0:
 | 
				
			||||||
            die('stopping at %s; script returned non-zero status' % ctx.subpath)
 | 
					            die(b'stopping at %s; script returned non-zero status' % ctx.subpath)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def cmd_update(self, options, args, ctx):
 | 
					    def cmd_update(self, options, args, ctx):
 | 
				
			||||||
        if not ctx.subrepo:
 | 
					        if not ctx.subrepo:
 | 
				
			||||||
@@ -729,7 +798,7 @@ class SubRepoCommand(SubCommand):
 | 
				
			|||||||
            self.run_cmd(options, ctx.repo, ['clone', src, ctx.subpath], cwd=None)
 | 
					            self.run_cmd(options, ctx.repo, ['clone', src, ctx.subpath], cwd=None)
 | 
				
			||||||
            ctx.subrepo = self.git_hg_repo_try(ctx.subpath)
 | 
					            ctx.subrepo = self.git_hg_repo_try(ctx.subpath)
 | 
				
			||||||
            if not ctx.subrepo:
 | 
					            if not ctx.subrepo:
 | 
				
			||||||
                die('subrepo %s setup clone failed', ctx.subpath)
 | 
					                die(b'subrepo %s setup clone failed' % ctx.subpath)
 | 
				
			||||||
            # force (detached) checkout of target commit following clone
 | 
					            # force (detached) checkout of target commit following clone
 | 
				
			||||||
            cmd = [ 'checkout', '-q' ]
 | 
					            cmd = [ 'checkout', '-q' ]
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
@@ -757,32 +826,32 @@ class SubRepoCommand(SubCommand):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    def cmd_status(self, options, args, ctx):
 | 
					    def cmd_status(self, options, args, ctx):
 | 
				
			||||||
        if not ctx.subrepo:
 | 
					        if not ctx.subrepo:
 | 
				
			||||||
            state = '-'
 | 
					            state = b'-'
 | 
				
			||||||
            revname = ''
 | 
					            revname = b''
 | 
				
			||||||
            _, gitcommit, kind = ctx.state
 | 
					            _, gitcommit, kind = ctx.state
 | 
				
			||||||
            if kind != 'git':
 | 
					            if kind != b'git':
 | 
				
			||||||
                gitcommit += '[hg] '
 | 
					                gitcommit += b'[hg] '
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            gitcommit = self.get_git_commit(ctx)
 | 
					            gitcommit = self.get_git_commit(ctx)
 | 
				
			||||||
            head = ctx.subrepo.rev_parse('HEAD')
 | 
					            head = ctx.subrepo.rev_parse(b'HEAD')
 | 
				
			||||||
            if head == gitcommit:
 | 
					            if head == gitcommit:
 | 
				
			||||||
                state = ' '
 | 
					                state = b' '
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
                state = '+'
 | 
					                state = b'+'
 | 
				
			||||||
                # option determines what to print
 | 
					                # option determines what to print
 | 
				
			||||||
                if not options.cached:
 | 
					                if not options.cached:
 | 
				
			||||||
                    gitcommit = head
 | 
					                    gitcommit = head
 | 
				
			||||||
            revname = ctx.subrepo.rev_describe(gitcommit)
 | 
					            revname = ctx.subrepo.rev_describe(gitcommit)
 | 
				
			||||||
            if revname:
 | 
					            if revname:
 | 
				
			||||||
                revname = ' (%s)' % revname
 | 
					                revname = b' (%s)' % revname
 | 
				
			||||||
        print "%s%s %s%s" % (state, gitcommit, ctx.subpath, revname)
 | 
					        puts(b"%s%s %s%s" % (state, gitcommit, ctx.subpath, revname))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def cmd_sync(self, options, args, ctx):
 | 
					    def cmd_sync(self, options, args, ctx):
 | 
				
			||||||
        if not ctx.subrepo:
 | 
					        if not ctx.subrepo:
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
        src, _, _ = ctx.state
 | 
					        src, _, _ = ctx.state
 | 
				
			||||||
        self.run_cmd(options, ctx.subrepo, \
 | 
					        self.run_cmd(options, ctx.subrepo, \
 | 
				
			||||||
            ['config', 'remote.%s.url' % (options.remote), src])
 | 
					            ['config', b'remote.%s.url' % (options.remote), src])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class RepoCommand(SubCommand):
 | 
					class RepoCommand(SubCommand):
 | 
				
			||||||
@@ -801,7 +870,7 @@ class RepoCommand(SubCommand):
 | 
				
			|||||||
        (remote, args) = self.get_remote(args)
 | 
					        (remote, args) = self.get_remote(args)
 | 
				
			||||||
        repos = self.githgrepo.get_hg_repos()
 | 
					        repos = self.githgrepo.get_hg_repos()
 | 
				
			||||||
        if remote in repos:
 | 
					        if remote in repos:
 | 
				
			||||||
            print repos[remote].rstrip('/')
 | 
					            puts(repos[remote].rstrip(b'/'))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class HgCommand(SubCommand):
 | 
					class HgCommand(SubCommand):
 | 
				
			||||||
@@ -821,8 +890,8 @@ class HgCommand(SubCommand):
 | 
				
			|||||||
        remote = self.subcommand
 | 
					        remote = self.subcommand
 | 
				
			||||||
        repos = self.githgrepo.get_hg_repos()
 | 
					        repos = self.githgrepo.get_hg_repos()
 | 
				
			||||||
        if len(args) and remote in repos:
 | 
					        if len(args) and remote in repos:
 | 
				
			||||||
            if args[0].find('hg') < 0:
 | 
					            if args[0].find(b'hg') < 0:
 | 
				
			||||||
                args.insert(0, 'hg')
 | 
					                args.insert(0, b'hg')
 | 
				
			||||||
            args[1:1] = ['-R', repos[remote]]
 | 
					            args[1:1] = ['-R', repos[remote]]
 | 
				
			||||||
            p = subprocess.Popen(args, stdout=None)
 | 
					            p = subprocess.Popen(args, stdout=None)
 | 
				
			||||||
            p.wait()
 | 
					            p.wait()
 | 
				
			||||||
@@ -847,12 +916,12 @@ class HelpCommand(SubCommand):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
def get_subcommands():
 | 
					def get_subcommands():
 | 
				
			||||||
    commands = {
 | 
					    commands = {
 | 
				
			||||||
        'hg-rev': HgRevCommand,
 | 
					        b'hg-rev': HgRevCommand,
 | 
				
			||||||
        'git-rev': GitRevCommand,
 | 
					        b'git-rev': GitRevCommand,
 | 
				
			||||||
        'repo': RepoCommand,
 | 
					        b'repo': RepoCommand,
 | 
				
			||||||
        'gc':  GcCommand,
 | 
					        b'gc':  GcCommand,
 | 
				
			||||||
        'sub': SubRepoCommand,
 | 
					        b'sub': SubRepoCommand,
 | 
				
			||||||
        'help' : HelpCommand
 | 
					        b'help' : HelpCommand
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    # add remote named subcommands
 | 
					    # add remote named subcommands
 | 
				
			||||||
    repos = githgrepo.get_hg_repos()
 | 
					    repos = githgrepo.get_hg_repos()
 | 
				
			||||||
@@ -885,11 +954,12 @@ def do_usage():
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    Available hg remotes:
 | 
					    Available hg remotes:
 | 
				
			||||||
    """)
 | 
					    """)
 | 
				
			||||||
 | 
					    usage = compat.to_b(usage)
 | 
				
			||||||
    for r in githgrepo.get_hg_repos():
 | 
					    for r in githgrepo.get_hg_repos():
 | 
				
			||||||
        usage += '\t%s\n' % (r)
 | 
					        usage += b'\t%s\n' % (r)
 | 
				
			||||||
    usage += '\n'
 | 
					    usage += b'\n'
 | 
				
			||||||
    sys.stderr.write(usage)
 | 
					    compat.stderr.write(usage)
 | 
				
			||||||
    sys.stderr.flush()
 | 
					    compat.stderr.flush()
 | 
				
			||||||
    sys.exit(2)
 | 
					    sys.exit(2)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def init_git(gitdir=None):
 | 
					def init_git(gitdir=None):
 | 
				
			||||||
@@ -897,7 +967,7 @@ def init_git(gitdir=None):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    try:
 | 
					    try:
 | 
				
			||||||
        githgrepo = GitHgRepo(gitdir=gitdir)
 | 
					        githgrepo = GitHgRepo(gitdir=gitdir)
 | 
				
			||||||
    except Exception, e:
 | 
					    except Exception as e:
 | 
				
			||||||
        die(str(e))
 | 
					        die(str(e))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def init_logger():
 | 
					def init_logger():
 | 
				
			||||||
@@ -916,8 +986,8 @@ def init_version():
 | 
				
			|||||||
    global hg_version
 | 
					    global hg_version
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    try:
 | 
					    try:
 | 
				
			||||||
        version, _, extra = util.version().partition('+')
 | 
					        version, _, extra = util.version().partition(b'+')
 | 
				
			||||||
        version = list(int(e) for e in version.split('.'))
 | 
					        version = list(int(e) for e in version.split(b'.'))
 | 
				
			||||||
        if extra:
 | 
					        if extra:
 | 
				
			||||||
            version[-1] += 1
 | 
					            version[-1] += 1
 | 
				
			||||||
        hg_version = tuple(version)
 | 
					        hg_version = tuple(version)
 | 
				
			||||||
@@ -933,19 +1003,21 @@ def main(argv):
 | 
				
			|||||||
    global subcommands
 | 
					    global subcommands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # as an alias, cwd is top dir, change again to original directory
 | 
					    # as an alias, cwd is top dir, change again to original directory
 | 
				
			||||||
    reldir = os.environ.get('GIT_PREFIX')
 | 
					    reldir = compat.getenv(b'GIT_PREFIX', None)
 | 
				
			||||||
    if reldir:
 | 
					    if reldir:
 | 
				
			||||||
        os.chdir(reldir)
 | 
					        os.chdir(reldir)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # init repo dir
 | 
					    # init repo dir
 | 
				
			||||||
    # we will take over dir management ...
 | 
					    # we will take over dir management ...
 | 
				
			||||||
    init_git(os.environ.pop('GIT_DIR', None))
 | 
					    gitdir = compat.getenv(b'GIT_DIR', None)
 | 
				
			||||||
 | 
					    os.environ.pop('GIT_DIR', None)
 | 
				
			||||||
 | 
					    init_git(gitdir)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    subcommands = get_subcommands()
 | 
					    subcommands = get_subcommands()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    cmd = ''
 | 
					    cmd = ''
 | 
				
			||||||
    if len(argv) > 1:
 | 
					    if len(argv) > 1:
 | 
				
			||||||
        cmd = argv[1]
 | 
					        cmd = compat.decode_sysarg(argv[1])
 | 
				
			||||||
    argv = argv[2:]
 | 
					    argv = argv[2:]
 | 
				
			||||||
    if cmd in subcommands:
 | 
					    if cmd in subcommands:
 | 
				
			||||||
        c = subcommands[cmd]
 | 
					        c = subcommands[cmd]
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										1075
									
								
								git-remote-hg
									
									
									
									
									
								
							
							
						
						
									
										1075
									
								
								git-remote-hg
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										45
									
								
								setup.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								setup.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,45 @@
 | 
				
			|||||||
 | 
					# git-remote-hg setuptools script
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import setuptools
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# strip leading v
 | 
				
			||||||
 | 
					version = 'v1.0.4'[1:]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# check for released version
 | 
				
			||||||
 | 
					assert (len(version) > 0)
 | 
				
			||||||
 | 
					assert (version.find('-') < 0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					long_description = \
 | 
				
			||||||
 | 
					"""
 | 
				
			||||||
 | 
					'git-remote-hg' is a gitremote protocol helper for Mercurial.
 | 
				
			||||||
 | 
					It allows you to clone, fetch and push to and from Mercurial repositories as if
 | 
				
			||||||
 | 
					they were Git ones using a hg::some-url URL.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See the homepage for much more explanation.
 | 
				
			||||||
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					CLASSIFIERS = [
 | 
				
			||||||
 | 
					    "Programming Language :: Python",
 | 
				
			||||||
 | 
					    "Programming Language :: Python :: 2",
 | 
				
			||||||
 | 
					    "Programming Language :: Python :: 2.7",
 | 
				
			||||||
 | 
					    "Programming Language :: Python :: 3",
 | 
				
			||||||
 | 
					    "Programming Language :: Python :: 3.6",
 | 
				
			||||||
 | 
					    "License :: OSI Approved",
 | 
				
			||||||
 | 
					    "License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
 | 
				
			||||||
 | 
					    "Development Status :: 5 - Production/Stable",
 | 
				
			||||||
 | 
					    "Intended Audience :: Developers",
 | 
				
			||||||
 | 
					]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					setuptools.setup(name="git-remote-hg",
 | 
				
			||||||
 | 
					      version=version,
 | 
				
			||||||
 | 
					      author="Mark Nauwelaerts",
 | 
				
			||||||
 | 
					      author_email="mnauw@users.sourceforge.net",
 | 
				
			||||||
 | 
					      url="http://github.com/mnauw/git-remote-hg",
 | 
				
			||||||
 | 
					      description="access hg repositories as git remotes",
 | 
				
			||||||
 | 
					      long_description=long_description,
 | 
				
			||||||
 | 
					      license="GPLv2",
 | 
				
			||||||
 | 
					      keywords="git hg mercurial",
 | 
				
			||||||
 | 
					      scripts=["git-remote-hg", "git-hg-helper"],
 | 
				
			||||||
 | 
					      classifiers=CLASSIFIERS
 | 
				
			||||||
 | 
					     )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1,9 +1,9 @@
 | 
				
			|||||||
RM ?= rm -f
 | 
					RM ?= rm -f
 | 
				
			||||||
 | 
					
 | 
				
			||||||
T = main.t main-push.t bidi.t helper.t
 | 
					T = main.t main-push.t bidi.t helper.t
 | 
				
			||||||
TEST_DIRECTORY := $(CURDIR)
 | 
					SHARNESS_TEST_DIRECTORY := $(CURDIR)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export TEST_DIRECTORY
 | 
					export SHARNESS_TEST_DIRECTORY
 | 
				
			||||||
 | 
					
 | 
				
			||||||
all: test
 | 
					all: test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -11,7 +11,7 @@ test: $(T)
 | 
				
			|||||||
	$(MAKE) clean
 | 
						$(MAKE) clean
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$(T):
 | 
					$(T):
 | 
				
			||||||
	$(SHELL) $@ $(TEST_OPTS)
 | 
						./$@ $(TEST_OPTS)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
clean:
 | 
					clean:
 | 
				
			||||||
	$(RM) -r 'trash directory'.* test-results
 | 
						$(RM) -r 'trash directory'.* test-results
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										55
									
								
								test/bidi.t
									
									
									
									
									
								
							
							
						
						
									
										55
									
								
								test/bidi.t
									
									
									
									
									
								
							@@ -1,4 +1,4 @@
 | 
				
			|||||||
#!/bin/sh
 | 
					#!/bin/bash
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Copyright (c) 2012 Felipe Contreras
 | 
					# Copyright (c) 2012 Felipe Contreras
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
@@ -8,20 +8,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
test_description='Test bidirectionality of remote-hg'
 | 
					test_description='Test bidirectionality of remote-hg'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test -n "$TEST_DIRECTORY" || TEST_DIRECTORY=$(dirname $0)/
 | 
					. ./test-lib.sh
 | 
				
			||||||
. "$TEST_DIRECTORY"/test-lib.sh
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
if ! test_have_prereq PYTHON
 | 
					 | 
				
			||||||
then
 | 
					 | 
				
			||||||
	skip_all='skipping remote-hg tests; python not available'
 | 
					 | 
				
			||||||
	test_done
 | 
					 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
if ! python2 -c 'import mercurial' > /dev/null 2>&1
 | 
					 | 
				
			||||||
then
 | 
					 | 
				
			||||||
	skip_all='skipping remote-hg tests; mercurial not available'
 | 
					 | 
				
			||||||
	test_done
 | 
					 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# clone to a git repo
 | 
					# clone to a git repo
 | 
				
			||||||
git_clone () {
 | 
					git_clone () {
 | 
				
			||||||
@@ -243,4 +230,42 @@ test_expect_success 'hg tags' '
 | 
				
			|||||||
	test_cmp expected actual
 | 
						test_cmp expected actual
 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test_expect_success 'test timezones' '
 | 
				
			||||||
 | 
						test_when_finished "rm -rf gitrepo* hgrepo*" &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						(
 | 
				
			||||||
 | 
						git init -q gitrepo &&
 | 
				
			||||||
 | 
						cd gitrepo &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						echo alpha > alpha &&
 | 
				
			||||||
 | 
						git add alpha &&
 | 
				
			||||||
 | 
						git commit -m "add alpha" --date="2007-01-01 00:00:00 +0000" &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						echo beta > beta &&
 | 
				
			||||||
 | 
						git add beta &&
 | 
				
			||||||
 | 
						git commit -m "add beta" --date="2007-01-01 00:00:00 +0100" &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						echo gamma > gamma &&
 | 
				
			||||||
 | 
						git add gamma &&
 | 
				
			||||||
 | 
						git commit -m "add gamma" --date="2007-01-01 00:00:00 -0100" &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						echo delta > delta &&
 | 
				
			||||||
 | 
						git add delta &&
 | 
				
			||||||
 | 
						git commit -m "add delta" --date="2007-01-01 00:00:00 +0130" &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						echo epsilon > epsilon &&
 | 
				
			||||||
 | 
						git add epsilon &&
 | 
				
			||||||
 | 
						git commit -m "add epsilon" --date="2007-01-01 00:00:00 -0130"
 | 
				
			||||||
 | 
						) &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						hg_clone gitrepo hgrepo &&
 | 
				
			||||||
 | 
						git_clone hgrepo gitrepo2 &&
 | 
				
			||||||
 | 
						hg_clone gitrepo2 hgrepo2 &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						hg_log hgrepo > expected &&
 | 
				
			||||||
 | 
						hg_log hgrepo2 > actual &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						test_cmp expected actual
 | 
				
			||||||
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_done
 | 
					test_done
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										60
									
								
								test/expected/converged merge/git-log
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										60
									
								
								test/expected/converged merge/git-log
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,60 @@
 | 
				
			|||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :1
 | 
				
			||||||
 | 
					data 2
 | 
				
			||||||
 | 
					A
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					reset refs/heads/master
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :2
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 0 +0000
 | 
				
			||||||
 | 
					committer A U Thor <author@example.com> 0 +0000
 | 
				
			||||||
 | 
					data 7
 | 
				
			||||||
 | 
					origin
 | 
				
			||||||
 | 
					M 100644 :1 afile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :3
 | 
				
			||||||
 | 
					data 2
 | 
				
			||||||
 | 
					C
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :4
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 3 +0000
 | 
				
			||||||
 | 
					committer A U Thor <author@example.com> 3 +0000
 | 
				
			||||||
 | 
					data 5
 | 
				
			||||||
 | 
					A->C
 | 
				
			||||||
 | 
					from :2
 | 
				
			||||||
 | 
					M 100644 :3 afile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :5
 | 
				
			||||||
 | 
					data 2
 | 
				
			||||||
 | 
					B
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :6
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 1 +0000
 | 
				
			||||||
 | 
					committer A U Thor <author@example.com> 1 +0000
 | 
				
			||||||
 | 
					data 5
 | 
				
			||||||
 | 
					A->B
 | 
				
			||||||
 | 
					from :2
 | 
				
			||||||
 | 
					M 100644 :5 afile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :7
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 2 +0000
 | 
				
			||||||
 | 
					committer A U Thor <author@example.com> 2 +0000
 | 
				
			||||||
 | 
					data 5
 | 
				
			||||||
 | 
					B->C
 | 
				
			||||||
 | 
					from :6
 | 
				
			||||||
 | 
					M 100644 :3 afile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :8
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 4 +0000
 | 
				
			||||||
 | 
					committer A U Thor <author@example.com> 4 +0000
 | 
				
			||||||
 | 
					data 6
 | 
				
			||||||
 | 
					merge
 | 
				
			||||||
 | 
					from :4
 | 
				
			||||||
 | 
					merge :7
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										67
									
								
								test/expected/converged merge/hg-log
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										67
									
								
								test/expected/converged merge/hg-log
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,67 @@
 | 
				
			|||||||
 | 
					changeset:   9a6668f453c3003b71e11bb8d7572af57a7ce891
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    331ac2e605f2e6092ccb3802244a65b71f3be726
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:00 1970 +0000
 | 
				
			||||||
 | 
					files+:      afile
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					origin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   ead35d346ecb18ce9d9d54604ff62b41caa196ce
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      9a6668f453c3003b71e11bb8d7572af57a7ce891
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    894f8ad9a84f743d52747963d0b9f4e9cf37d489
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:01 1970 +0000
 | 
				
			||||||
 | 
					files:       afile
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					A->B
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   541c7bc8b2d01c8bf71b2298d17edcda120e49bf
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      ead35d346ecb18ce9d9d54604ff62b41caa196ce
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    04dae4001cb1fb2384111589720617c4b742044c
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:02 1970 +0000
 | 
				
			||||||
 | 
					files:       afile
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					B->C
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   5694aadcd7171ecb9768b13e29d027e22a360d44
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      9a6668f453c3003b71e11bb8d7572af57a7ce891
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    6efc6bb8e097947aa212887bdb01fb89dfa3de13
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:03 1970 +0000
 | 
				
			||||||
 | 
					files:       afile
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					A->C
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   9ee75b4362cc15f9110d6538b2f1c9f0cf14825a
 | 
				
			||||||
 | 
					bookmark:    master
 | 
				
			||||||
 | 
					tag:         tip
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      5694aadcd7171ecb9768b13e29d027e22a360d44
 | 
				
			||||||
 | 
					parent:      541c7bc8b2d01c8bf71b2298d17edcda120e49bf
 | 
				
			||||||
 | 
					manifest:    eb9f4687448653e876d787cd6f2e59140680ff09
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:04 1970 +0000
 | 
				
			||||||
 | 
					files:       afile
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					merge
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										56
									
								
								test/expected/encoding/git-log
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										56
									
								
								test/expected/encoding/git-log
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,56 @@
 | 
				
			|||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :1
 | 
				
			||||||
 | 
					data 6
 | 
				
			||||||
 | 
					alpha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					reset refs/heads/master
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :2
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					committer C O Mitter <committer@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					data 12
 | 
				
			||||||
 | 
					add älphà
 | 
				
			||||||
 | 
					M 100644 :1 alpha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :3
 | 
				
			||||||
 | 
					data 5
 | 
				
			||||||
 | 
					beta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :4
 | 
				
			||||||
 | 
					author tést èncödîng <author@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					committer C O Mitter <committer@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					data 9
 | 
				
			||||||
 | 
					add beta
 | 
				
			||||||
 | 
					from :2
 | 
				
			||||||
 | 
					M 100644 :3 beta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :5
 | 
				
			||||||
 | 
					data 6
 | 
				
			||||||
 | 
					gamma
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :6
 | 
				
			||||||
 | 
					author tést èncödîng <author@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					committer C O Mitter <committer@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					data 12
 | 
				
			||||||
 | 
					add gämmâ
 | 
				
			||||||
 | 
					from :4
 | 
				
			||||||
 | 
					M 100644 :5 gamma
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :7
 | 
				
			||||||
 | 
					data 6
 | 
				
			||||||
 | 
					delta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :8
 | 
				
			||||||
 | 
					author tést èncödîng <author@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					committer C O Mitter <committer@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					data 12
 | 
				
			||||||
 | 
					add déltà
 | 
				
			||||||
 | 
					from :6
 | 
				
			||||||
 | 
					M 100644 :7 delta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										58
									
								
								test/expected/encoding/hg-log
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										58
									
								
								test/expected/encoding/hg-log
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,58 @@
 | 
				
			|||||||
 | 
					changeset:   6674f1c866b5c428db4acde16404c14077889646
 | 
				
			||||||
 | 
					bookmark:    master
 | 
				
			||||||
 | 
					tag:         tip
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      7e9fd3fd2f75d7de4bf3d77c47f192a51927ac28
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    ea49f93388380ead5601c8fcbfa187516e7c2ed8
 | 
				
			||||||
 | 
					user:        tést èncödîng <author@example.com>
 | 
				
			||||||
 | 
					date:        Mon Jan 01 00:00:00 2007 +0230
 | 
				
			||||||
 | 
					files+:      delta
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					extra:       committer=C O Mitter <committer@example.com> 1167600600 -9000
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					add déltà
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   7e9fd3fd2f75d7de4bf3d77c47f192a51927ac28
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      99c5adad03b9a9935e181f4be91ff7693a790110
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    f580e7da3673c137370da2b931a1dee83590d7b4
 | 
				
			||||||
 | 
					user:        tést èncödîng <author@example.com>
 | 
				
			||||||
 | 
					date:        Mon Jan 01 00:00:00 2007 +0230
 | 
				
			||||||
 | 
					files+:      gamma
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					extra:       committer=C O Mitter <committer@example.com> 1167600600 -9000
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					add gämmâ
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   99c5adad03b9a9935e181f4be91ff7693a790110
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      1e3e49d2cc8feaad4942d100108f20f207742d3a
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    f0bd6fbafbaebe4bb59c35108428f6fce152431d
 | 
				
			||||||
 | 
					user:        tést èncödîng <author@example.com>
 | 
				
			||||||
 | 
					date:        Mon Jan 01 00:00:00 2007 +0230
 | 
				
			||||||
 | 
					files+:      beta
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					extra:       committer=C O Mitter <committer@example.com> 1167600600 -9000
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					add beta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   1e3e49d2cc8feaad4942d100108f20f207742d3a
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    8b8a0e87dfd7a0706c0524afa8ba67e20544cbf0
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Mon Jan 01 00:00:00 2007 +0230
 | 
				
			||||||
 | 
					files+:      alpha
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					extra:       committer=C O Mitter <committer@example.com> 1167600600 -9000
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					add älphà
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										32
									
								
								test/expected/executable bit/log
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								test/expected/executable bit/log
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,32 @@
 | 
				
			|||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :1
 | 
				
			||||||
 | 
					data 6
 | 
				
			||||||
 | 
					alpha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					reset refs/heads/master
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :2
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					committer C O Mitter <committer@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					data 10
 | 
				
			||||||
 | 
					add alpha
 | 
				
			||||||
 | 
					M 100644 :1 alpha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :3
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					committer C O Mitter <committer@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					data 19
 | 
				
			||||||
 | 
					set executable bit
 | 
				
			||||||
 | 
					from :2
 | 
				
			||||||
 | 
					M 100755 :1 alpha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :4
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					committer C O Mitter <committer@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					data 21
 | 
				
			||||||
 | 
					clear executable bit
 | 
				
			||||||
 | 
					from :3
 | 
				
			||||||
 | 
					M 100644 :1 alpha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										46
									
								
								test/expected/executable bit/output
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								test/expected/executable bit/output
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,46 @@
 | 
				
			|||||||
 | 
					changeset:   1efb93106a36bf71352ab04e769a3422522cf946
 | 
				
			||||||
 | 
					bookmark:    master
 | 
				
			||||||
 | 
					tag:         tip
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      d7cae8b1fdab97568ba5eca44ca2bf5a44d7c394
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    51e6255d794f794a8c4e0f03edf264444e3c5ce7
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Mon Jan 01 00:00:00 2007 +0230
 | 
				
			||||||
 | 
					files:       alpha
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					extra:       committer=C O Mitter <committer@example.com> 1167600600 -9000
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					clear executable bit
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   d7cae8b1fdab97568ba5eca44ca2bf5a44d7c394
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      362b656574c3c9e89fa7f2d7a943091dc93bce4d
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    e4bf4ef5e9aea7a6a57573e533a5519bd062f144
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Mon Jan 01 00:00:00 2007 +0230
 | 
				
			||||||
 | 
					files:       alpha
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					extra:       committer=C O Mitter <committer@example.com> 1167600600 -9000
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					set executable bit
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   362b656574c3c9e89fa7f2d7a943091dc93bce4d
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    8b8a0e87dfd7a0706c0524afa8ba67e20544cbf0
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Mon Jan 01 00:00:00 2007 +0230
 | 
				
			||||||
 | 
					files+:      alpha
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					extra:       committer=C O Mitter <committer@example.com> 1167600600 -9000
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					add alpha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					644   alpha
 | 
				
			||||||
 | 
					644   alpha
 | 
				
			||||||
							
								
								
									
										60
									
								
								test/expected/file removal/log
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										60
									
								
								test/expected/file removal/log
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,60 @@
 | 
				
			|||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :1
 | 
				
			||||||
 | 
					data 6
 | 
				
			||||||
 | 
					alpha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					reset refs/heads/master
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :2
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					committer C O Mitter <committer@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					data 10
 | 
				
			||||||
 | 
					add alpha
 | 
				
			||||||
 | 
					M 100644 :1 alpha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :3
 | 
				
			||||||
 | 
					data 5
 | 
				
			||||||
 | 
					beta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :4
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					committer C O Mitter <committer@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					data 9
 | 
				
			||||||
 | 
					add beta
 | 
				
			||||||
 | 
					from :2
 | 
				
			||||||
 | 
					M 100644 :3 beta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :5
 | 
				
			||||||
 | 
					data 5
 | 
				
			||||||
 | 
					blah
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :6
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					committer C O Mitter <committer@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					data 8
 | 
				
			||||||
 | 
					add foo
 | 
				
			||||||
 | 
					from :4
 | 
				
			||||||
 | 
					M 100644 :5 foo/bar
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :7
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					committer C O Mitter <committer@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					data 13
 | 
				
			||||||
 | 
					remove alpha
 | 
				
			||||||
 | 
					from :6
 | 
				
			||||||
 | 
					D alpha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :8
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					committer C O Mitter <committer@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					data 15
 | 
				
			||||||
 | 
					remove foo/bar
 | 
				
			||||||
 | 
					from :7
 | 
				
			||||||
 | 
					D foo/bar
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										75
									
								
								test/expected/file removal/output
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										75
									
								
								test/expected/file removal/output
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,75 @@
 | 
				
			|||||||
 | 
					changeset:   54f595cbdf1f516dc3b2b25faa6f051aae712f5d
 | 
				
			||||||
 | 
					bookmark:    master
 | 
				
			||||||
 | 
					tag:         tip
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      7fe32a9185c6d37db430ee5248cdb2ae66582478
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    3f83f42fa00fb0cac14a83aa48baac2f287a9329
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Mon Jan 01 00:00:00 2007 +0230
 | 
				
			||||||
 | 
					files-:      foo/bar
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					extra:       committer=C O Mitter <committer@example.com> 1167600600 -9000
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					remove foo/bar
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   7fe32a9185c6d37db430ee5248cdb2ae66582478
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      a21fd0b26a555427c2ea72f8ed37190f6216f705
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    cd10925837609b99d345c44c85bd1f73d742cbbc
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Mon Jan 01 00:00:00 2007 +0230
 | 
				
			||||||
 | 
					files-:      alpha
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					extra:       committer=C O Mitter <committer@example.com> 1167600600 -9000
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					remove alpha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   a21fd0b26a555427c2ea72f8ed37190f6216f705
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      7cd99375c843931bd8959b766a94e050f428512b
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    a6ee442a94bfc6fb0b7d717183bb8b4534ca4ccd
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Mon Jan 01 00:00:00 2007 +0230
 | 
				
			||||||
 | 
					files+:      foo/bar
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					extra:       committer=C O Mitter <committer@example.com> 1167600600 -9000
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					add foo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   7cd99375c843931bd8959b766a94e050f428512b
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      362b656574c3c9e89fa7f2d7a943091dc93bce4d
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    f0bd6fbafbaebe4bb59c35108428f6fce152431d
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Mon Jan 01 00:00:00 2007 +0230
 | 
				
			||||||
 | 
					files+:      beta
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					extra:       committer=C O Mitter <committer@example.com> 1167600600 -9000
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					add beta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   362b656574c3c9e89fa7f2d7a943091dc93bce4d
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    8b8a0e87dfd7a0706c0524afa8ba67e20544cbf0
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Mon Jan 01 00:00:00 2007 +0230
 | 
				
			||||||
 | 
					files+:      alpha
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					extra:       committer=C O Mitter <committer@example.com> 1167600600 -9000
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					add alpha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					beta
 | 
				
			||||||
 | 
					foo/bar
 | 
				
			||||||
 | 
					beta
 | 
				
			||||||
							
								
								
									
										32
									
								
								test/expected/git tags/log
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								test/expected/git tags/log
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,32 @@
 | 
				
			|||||||
 | 
					changeset:   7cd99375c843931bd8959b766a94e050f428512b
 | 
				
			||||||
 | 
					bookmark:    master
 | 
				
			||||||
 | 
					tag:         beta
 | 
				
			||||||
 | 
					tag:         tip
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      362b656574c3c9e89fa7f2d7a943091dc93bce4d
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    f0bd6fbafbaebe4bb59c35108428f6fce152431d
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Mon Jan 01 00:00:00 2007 +0230
 | 
				
			||||||
 | 
					files+:      beta
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					extra:       committer=C O Mitter <committer@example.com> 1167600600 -9000
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					add beta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   362b656574c3c9e89fa7f2d7a943091dc93bce4d
 | 
				
			||||||
 | 
					tag:         alpha
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    8b8a0e87dfd7a0706c0524afa8ba67e20544cbf0
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Mon Jan 01 00:00:00 2007 +0230
 | 
				
			||||||
 | 
					files+:      alpha
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					extra:       committer=C O Mitter <committer@example.com> 1167600600 -9000
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					add alpha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										141
									
								
								test/expected/hg author/git-log
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										141
									
								
								test/expected/hg author/git-log
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,141 @@
 | 
				
			|||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :1
 | 
				
			||||||
 | 
					data 6
 | 
				
			||||||
 | 
					alpha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					reset refs/heads/not-master
 | 
				
			||||||
 | 
					commit refs/heads/not-master
 | 
				
			||||||
 | 
					mark :2
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					committer C O Mitter <committer@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					data 10
 | 
				
			||||||
 | 
					add alpha
 | 
				
			||||||
 | 
					M 100644 :1 alpha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :3
 | 
				
			||||||
 | 
					data 5
 | 
				
			||||||
 | 
					beta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :4
 | 
				
			||||||
 | 
					author test <none@none> 0 +0000
 | 
				
			||||||
 | 
					committer test <none@none> 0 +0000
 | 
				
			||||||
 | 
					data 9
 | 
				
			||||||
 | 
					add beta
 | 
				
			||||||
 | 
					from :2
 | 
				
			||||||
 | 
					M 100644 :3 beta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :5
 | 
				
			||||||
 | 
					data 11
 | 
				
			||||||
 | 
					beta
 | 
				
			||||||
 | 
					gamma
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :6
 | 
				
			||||||
 | 
					author test ext:(%20%28comment%29) <test@example.com> 0 +0000
 | 
				
			||||||
 | 
					committer test ext:(%20%28comment%29) <test@example.com> 0 +0000
 | 
				
			||||||
 | 
					data 12
 | 
				
			||||||
 | 
					modify beta
 | 
				
			||||||
 | 
					from :4
 | 
				
			||||||
 | 
					M 100644 :5 beta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :7
 | 
				
			||||||
 | 
					data 6
 | 
				
			||||||
 | 
					gamma
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :8
 | 
				
			||||||
 | 
					author  <test@example.com> 0 +0000
 | 
				
			||||||
 | 
					committer  <test@example.com> 0 +0000
 | 
				
			||||||
 | 
					data 10
 | 
				
			||||||
 | 
					add gamma
 | 
				
			||||||
 | 
					from :6
 | 
				
			||||||
 | 
					M 100644 :7 gamma
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :9
 | 
				
			||||||
 | 
					data 6
 | 
				
			||||||
 | 
					delta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :10
 | 
				
			||||||
 | 
					author name <test@example.com> 0 +0000
 | 
				
			||||||
 | 
					committer name <test@example.com> 0 +0000
 | 
				
			||||||
 | 
					data 10
 | 
				
			||||||
 | 
					add delta
 | 
				
			||||||
 | 
					from :8
 | 
				
			||||||
 | 
					M 100644 :9 delta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :11
 | 
				
			||||||
 | 
					data 8
 | 
				
			||||||
 | 
					epsilon
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :12
 | 
				
			||||||
 | 
					author name <test@example.com> 0 +0000
 | 
				
			||||||
 | 
					committer name <test@example.com> 0 +0000
 | 
				
			||||||
 | 
					data 12
 | 
				
			||||||
 | 
					add epsilon
 | 
				
			||||||
 | 
					from :10
 | 
				
			||||||
 | 
					M 100644 :11 epsilon
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :13
 | 
				
			||||||
 | 
					data 5
 | 
				
			||||||
 | 
					zeta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :14
 | 
				
			||||||
 | 
					author test <none@none> 0 +0000
 | 
				
			||||||
 | 
					committer test <none@none> 0 +0000
 | 
				
			||||||
 | 
					data 9
 | 
				
			||||||
 | 
					add zeta
 | 
				
			||||||
 | 
					from :12
 | 
				
			||||||
 | 
					M 100644 :13 zeta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :15
 | 
				
			||||||
 | 
					data 4
 | 
				
			||||||
 | 
					eta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :16
 | 
				
			||||||
 | 
					author test <test@example.com> 0 +0000
 | 
				
			||||||
 | 
					committer test <test@example.com> 0 +0000
 | 
				
			||||||
 | 
					data 8
 | 
				
			||||||
 | 
					add eta
 | 
				
			||||||
 | 
					from :14
 | 
				
			||||||
 | 
					M 100644 :15 eta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :17
 | 
				
			||||||
 | 
					data 6
 | 
				
			||||||
 | 
					theta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :18
 | 
				
			||||||
 | 
					author test ?test@example.com <test ?test@example.com> 0 +0000
 | 
				
			||||||
 | 
					committer test ?test@example.com <test ?test@example.com> 0 +0000
 | 
				
			||||||
 | 
					data 10
 | 
				
			||||||
 | 
					add theta
 | 
				
			||||||
 | 
					from :16
 | 
				
			||||||
 | 
					M 100644 :17 theta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :19
 | 
				
			||||||
 | 
					data 5
 | 
				
			||||||
 | 
					iota
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :20
 | 
				
			||||||
 | 
					author test ext:(%20example%20%3Cdot%3E%20com%3E) <test ?at> 0 +0000
 | 
				
			||||||
 | 
					committer test ext:(%20example%20%3Cdot%3E%20com%3E) <test ?at> 0 +0000
 | 
				
			||||||
 | 
					data 9
 | 
				
			||||||
 | 
					add iota
 | 
				
			||||||
 | 
					from :18
 | 
				
			||||||
 | 
					M 100644 :19 iota
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										134
									
								
								test/expected/hg author/hg-log
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										134
									
								
								test/expected/hg author/hg-log
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,134 @@
 | 
				
			|||||||
 | 
					changeset:   307c03466a07cccafaafc991f36d695d6ad595f3
 | 
				
			||||||
 | 
					bookmark:    master
 | 
				
			||||||
 | 
					tag:         tip
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      5832614d351449a2f8d6f7ccbef4877c2b18cbe0
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    e8f1b3ae088bdd25e3570a4953ccb6b948524473
 | 
				
			||||||
 | 
					user:        test <test ?at> example <dot> com>
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:00 1970 +0000
 | 
				
			||||||
 | 
					files+:      iota
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					add iota
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   5832614d351449a2f8d6f7ccbef4877c2b18cbe0
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      e52ded4aca5d210ed58c63158d64fb911876f345
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    7e4875db7e2970c529f462520121d333e514bf4d
 | 
				
			||||||
 | 
					user:        test ?test@example.com <test ?test@example.com>
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:00 1970 +0000
 | 
				
			||||||
 | 
					files+:      theta
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					add theta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   e52ded4aca5d210ed58c63158d64fb911876f345
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      9a34ba7d552e8b73ad306baf1d1eb83de0f74c12
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    ef03e54a9916ac3158c9686503dd4f609c26b3ec
 | 
				
			||||||
 | 
					user:        test <test@example.com>
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:00 1970 +0000
 | 
				
			||||||
 | 
					files+:      eta
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					add eta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   9a34ba7d552e8b73ad306baf1d1eb83de0f74c12
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      6281edc25b9fe9538407726f044a9a61ac7ba5bc
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    616201b85baf7ed02d41f6a7deb04c52009d8483
 | 
				
			||||||
 | 
					user:        test
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:00 1970 +0000
 | 
				
			||||||
 | 
					files+:      zeta
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					add zeta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   6281edc25b9fe9538407726f044a9a61ac7ba5bc
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      4c7841053c633cb51f8375555d08b6bea54fc4cb
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    c703b3d7be8a0638047142f57ff83d4e94b5d1fa
 | 
				
			||||||
 | 
					user:        name <test@example.com>
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:00 1970 +0000
 | 
				
			||||||
 | 
					files+:      epsilon
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					add epsilon
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   4c7841053c633cb51f8375555d08b6bea54fc4cb
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      fa8f26586397dd4797842e9300c8db221fe5514d
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    300b54001cbfa5d027b4bccdb594ccb463adb55d
 | 
				
			||||||
 | 
					user:        name <test@example.com>
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:00 1970 +0000
 | 
				
			||||||
 | 
					files+:      delta
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					add delta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   fa8f26586397dd4797842e9300c8db221fe5514d
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      2708ff417fb7e2c0a4f9596286c0a398553fa793
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    45b0c483a79307d14f7e234feb78776478f828ec
 | 
				
			||||||
 | 
					user:        <test@example.com>
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:00 1970 +0000
 | 
				
			||||||
 | 
					files+:      gamma
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					add gamma
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   2708ff417fb7e2c0a4f9596286c0a398553fa793
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      8c51e5fe974fe1cc63a56bbfad343f9ede6bed30
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    c305998040b12e956b998318982c9eb92d2d7b28
 | 
				
			||||||
 | 
					user:        test <test@example.com> (comment)
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:00 1970 +0000
 | 
				
			||||||
 | 
					files:       beta
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					modify beta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   8c51e5fe974fe1cc63a56bbfad343f9ede6bed30
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      362b656574c3c9e89fa7f2d7a943091dc93bce4d
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    f0bd6fbafbaebe4bb59c35108428f6fce152431d
 | 
				
			||||||
 | 
					user:        test
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:00 1970 +0000
 | 
				
			||||||
 | 
					files+:      beta
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					add beta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   362b656574c3c9e89fa7f2d7a943091dc93bce4d
 | 
				
			||||||
 | 
					bookmark:    not-master
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    8b8a0e87dfd7a0706c0524afa8ba67e20544cbf0
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Mon Jan 01 00:00:00 2007 +0230
 | 
				
			||||||
 | 
					files+:      alpha
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					extra:       committer=C O Mitter <committer@example.com> 1167600600 -9000
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					add alpha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										38
									
								
								test/expected/hg branch/git-log
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								test/expected/hg branch/git-log
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,38 @@
 | 
				
			|||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :1
 | 
				
			||||||
 | 
					data 6
 | 
				
			||||||
 | 
					alpha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					reset refs/heads/not-master
 | 
				
			||||||
 | 
					commit refs/heads/not-master
 | 
				
			||||||
 | 
					mark :2
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					committer C O Mitter <committer@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					data 10
 | 
				
			||||||
 | 
					add alpha
 | 
				
			||||||
 | 
					M 100644 :1 alpha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :3
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 0 +0000
 | 
				
			||||||
 | 
					committer A U Thor <author@example.com> 0 +0000
 | 
				
			||||||
 | 
					data 52
 | 
				
			||||||
 | 
					rename alpha to beta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--HG--
 | 
				
			||||||
 | 
					rename : alpha => beta
 | 
				
			||||||
 | 
					from :2
 | 
				
			||||||
 | 
					D alpha
 | 
				
			||||||
 | 
					M 100644 :1 beta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :4
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 0 +0000
 | 
				
			||||||
 | 
					committer A U Thor <author@example.com> 0 +0000
 | 
				
			||||||
 | 
					data 44
 | 
				
			||||||
 | 
					started branch gamma
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--HG--
 | 
				
			||||||
 | 
					branch : gamma
 | 
				
			||||||
 | 
					from :3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										44
									
								
								test/expected/hg branch/hg-log
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								test/expected/hg branch/hg-log
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,44 @@
 | 
				
			|||||||
 | 
					changeset:   3320583a8de0b31511f499a4ab3426bee1a7f478
 | 
				
			||||||
 | 
					branch:      gamma
 | 
				
			||||||
 | 
					bookmark:    master
 | 
				
			||||||
 | 
					tag:         tip
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      5889597089fea2d144989baa9427d1a080293fdb
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    e353b4d5282d044ad738398fd32d0b684d04a14b
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:00 1970 +0000
 | 
				
			||||||
 | 
					extra:       branch=gamma
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					started branch gamma
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   5889597089fea2d144989baa9427d1a080293fdb
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      362b656574c3c9e89fa7f2d7a943091dc93bce4d
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    e353b4d5282d044ad738398fd32d0b684d04a14b
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:00 1970 +0000
 | 
				
			||||||
 | 
					files+:      beta
 | 
				
			||||||
 | 
					files-:      alpha
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					rename alpha to beta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   362b656574c3c9e89fa7f2d7a943091dc93bce4d
 | 
				
			||||||
 | 
					bookmark:    not-master
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    8b8a0e87dfd7a0706c0524afa8ba67e20544cbf0
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Mon Jan 01 00:00:00 2007 +0230
 | 
				
			||||||
 | 
					files+:      alpha
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					extra:       committer=C O Mitter <committer@example.com> 1167600600 -9000
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					add alpha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										33
									
								
								test/expected/hg tags/output
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								test/expected/hg tags/output
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,33 @@
 | 
				
			|||||||
 | 
					alpha
 | 
				
			||||||
 | 
					changeset:   16869bbe54be9f8082a8aec346de09f6c05cf1de
 | 
				
			||||||
 | 
					bookmark:    master
 | 
				
			||||||
 | 
					tag:         tip
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      362b656574c3c9e89fa7f2d7a943091dc93bce4d
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    26f8145fb5b20cc6f70dd131b646f95ab79738c0
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:00 1970 +0000
 | 
				
			||||||
 | 
					files+:      .hgtags
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					Added tag alpha for changeset 362b656574c3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   362b656574c3c9e89fa7f2d7a943091dc93bce4d
 | 
				
			||||||
 | 
					bookmark:    not-master
 | 
				
			||||||
 | 
					tag:         alpha
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    8b8a0e87dfd7a0706c0524afa8ba67e20544cbf0
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Mon Jan 01 00:00:00 2007 +0230
 | 
				
			||||||
 | 
					files+:      alpha
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					extra:       committer=C O Mitter <committer@example.com> 1167600600 -9000
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					add alpha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					362b656574c3c9e89fa7f2d7a943091dc93bce4d alpha
 | 
				
			||||||
							
								
								
									
										51
									
								
								test/expected/merge conflict 1/git-log
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								test/expected/merge conflict 1/git-log
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,51 @@
 | 
				
			|||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :1
 | 
				
			||||||
 | 
					data 2
 | 
				
			||||||
 | 
					A
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					reset refs/heads/master
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :2
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 0 +0000
 | 
				
			||||||
 | 
					committer A U Thor <author@example.com> 0 +0000
 | 
				
			||||||
 | 
					data 7
 | 
				
			||||||
 | 
					origin
 | 
				
			||||||
 | 
					M 100644 :1 afile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :3
 | 
				
			||||||
 | 
					data 2
 | 
				
			||||||
 | 
					C
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :4
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 2 +0000
 | 
				
			||||||
 | 
					committer A U Thor <author@example.com> 2 +0000
 | 
				
			||||||
 | 
					data 5
 | 
				
			||||||
 | 
					A->C
 | 
				
			||||||
 | 
					from :2
 | 
				
			||||||
 | 
					M 100644 :3 afile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :5
 | 
				
			||||||
 | 
					data 2
 | 
				
			||||||
 | 
					B
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :6
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 1 +0000
 | 
				
			||||||
 | 
					committer A U Thor <author@example.com> 1 +0000
 | 
				
			||||||
 | 
					data 5
 | 
				
			||||||
 | 
					A->B
 | 
				
			||||||
 | 
					from :2
 | 
				
			||||||
 | 
					M 100644 :5 afile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :7
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 3 +0000
 | 
				
			||||||
 | 
					committer A U Thor <author@example.com> 3 +0000
 | 
				
			||||||
 | 
					data 11
 | 
				
			||||||
 | 
					merge to C
 | 
				
			||||||
 | 
					from :4
 | 
				
			||||||
 | 
					merge :6
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										54
									
								
								test/expected/merge conflict 1/hg-log
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								test/expected/merge conflict 1/hg-log
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,54 @@
 | 
				
			|||||||
 | 
					changeset:   9a6668f453c3003b71e11bb8d7572af57a7ce891
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    331ac2e605f2e6092ccb3802244a65b71f3be726
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:00 1970 +0000
 | 
				
			||||||
 | 
					files+:      afile
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					origin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   ead35d346ecb18ce9d9d54604ff62b41caa196ce
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      9a6668f453c3003b71e11bb8d7572af57a7ce891
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    894f8ad9a84f743d52747963d0b9f4e9cf37d489
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:01 1970 +0000
 | 
				
			||||||
 | 
					files:       afile
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					A->B
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   d585ac55494928500f510b965b878d47f9ee60f6
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      9a6668f453c3003b71e11bb8d7572af57a7ce891
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    6efc6bb8e097947aa212887bdb01fb89dfa3de13
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:02 1970 +0000
 | 
				
			||||||
 | 
					files:       afile
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					A->C
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   c6ab734e24c39948e5a25713b48f4972c960ff8b
 | 
				
			||||||
 | 
					bookmark:    master
 | 
				
			||||||
 | 
					tag:         tip
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      d585ac55494928500f510b965b878d47f9ee60f6
 | 
				
			||||||
 | 
					parent:      ead35d346ecb18ce9d9d54604ff62b41caa196ce
 | 
				
			||||||
 | 
					manifest:    96bedb13781f1b9d729a2210a530f0c5c68f42e6
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:03 1970 +0000
 | 
				
			||||||
 | 
					files:       afile
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					merge to C
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										52
									
								
								test/expected/merge conflict 2/git-log
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								test/expected/merge conflict 2/git-log
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,52 @@
 | 
				
			|||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :1
 | 
				
			||||||
 | 
					data 2
 | 
				
			||||||
 | 
					A
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					reset refs/heads/master
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :2
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 0 +0000
 | 
				
			||||||
 | 
					committer A U Thor <author@example.com> 0 +0000
 | 
				
			||||||
 | 
					data 7
 | 
				
			||||||
 | 
					origin
 | 
				
			||||||
 | 
					M 100644 :1 afile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :3
 | 
				
			||||||
 | 
					data 2
 | 
				
			||||||
 | 
					C
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :4
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 2 +0000
 | 
				
			||||||
 | 
					committer A U Thor <author@example.com> 2 +0000
 | 
				
			||||||
 | 
					data 5
 | 
				
			||||||
 | 
					A->C
 | 
				
			||||||
 | 
					from :2
 | 
				
			||||||
 | 
					M 100644 :3 afile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :5
 | 
				
			||||||
 | 
					data 2
 | 
				
			||||||
 | 
					B
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :6
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 1 +0000
 | 
				
			||||||
 | 
					committer A U Thor <author@example.com> 1 +0000
 | 
				
			||||||
 | 
					data 5
 | 
				
			||||||
 | 
					A->B
 | 
				
			||||||
 | 
					from :2
 | 
				
			||||||
 | 
					M 100644 :5 afile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :7
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 3 +0000
 | 
				
			||||||
 | 
					committer A U Thor <author@example.com> 3 +0000
 | 
				
			||||||
 | 
					data 11
 | 
				
			||||||
 | 
					merge to B
 | 
				
			||||||
 | 
					from :4
 | 
				
			||||||
 | 
					merge :6
 | 
				
			||||||
 | 
					M 100644 :5 afile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										54
									
								
								test/expected/merge conflict 2/hg-log
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								test/expected/merge conflict 2/hg-log
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,54 @@
 | 
				
			|||||||
 | 
					changeset:   9a6668f453c3003b71e11bb8d7572af57a7ce891
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    331ac2e605f2e6092ccb3802244a65b71f3be726
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:00 1970 +0000
 | 
				
			||||||
 | 
					files+:      afile
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					origin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   ead35d346ecb18ce9d9d54604ff62b41caa196ce
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      9a6668f453c3003b71e11bb8d7572af57a7ce891
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    894f8ad9a84f743d52747963d0b9f4e9cf37d489
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:01 1970 +0000
 | 
				
			||||||
 | 
					files:       afile
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					A->B
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   d585ac55494928500f510b965b878d47f9ee60f6
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      9a6668f453c3003b71e11bb8d7572af57a7ce891
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    6efc6bb8e097947aa212887bdb01fb89dfa3de13
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:02 1970 +0000
 | 
				
			||||||
 | 
					files:       afile
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					A->C
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   542b187b70e70dc759631d1065794f3c2c5a3e7b
 | 
				
			||||||
 | 
					bookmark:    master
 | 
				
			||||||
 | 
					tag:         tip
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      d585ac55494928500f510b965b878d47f9ee60f6
 | 
				
			||||||
 | 
					parent:      ead35d346ecb18ce9d9d54604ff62b41caa196ce
 | 
				
			||||||
 | 
					manifest:    0907d7dbc98790102fa6cb91b68b271ef0bc5b64
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:03 1970 +0000
 | 
				
			||||||
 | 
					files:       afile
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					merge to B
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										27
									
								
								test/expected/rename/git-log
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								test/expected/rename/git-log
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
				
			|||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :1
 | 
				
			||||||
 | 
					data 6
 | 
				
			||||||
 | 
					alpha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					reset refs/heads/master
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :2
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 0 +0000
 | 
				
			||||||
 | 
					committer A U Thor <author@example.com> 0 +0000
 | 
				
			||||||
 | 
					data 10
 | 
				
			||||||
 | 
					add alpha
 | 
				
			||||||
 | 
					M 100644 :1 alpha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :3
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 0 +0000
 | 
				
			||||||
 | 
					committer A U Thor <author@example.com> 0 +0000
 | 
				
			||||||
 | 
					data 52
 | 
				
			||||||
 | 
					rename alpha to beta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					--HG--
 | 
				
			||||||
 | 
					rename : alpha => beta
 | 
				
			||||||
 | 
					from :2
 | 
				
			||||||
 | 
					D alpha
 | 
				
			||||||
 | 
					M 100644 :1 beta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										29
									
								
								test/expected/rename/hg-log
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								test/expected/rename/hg-log
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,29 @@
 | 
				
			|||||||
 | 
					changeset:   a985b184598fd779e53576c65c5dd1d274736c73
 | 
				
			||||||
 | 
					bookmark:    master
 | 
				
			||||||
 | 
					tag:         tip
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      0558a161e3ca0d59f5f165e3182402d9f1e574a8
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    e353b4d5282d044ad738398fd32d0b684d04a14b
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:00 1970 +0000
 | 
				
			||||||
 | 
					files+:      beta
 | 
				
			||||||
 | 
					files-:      alpha
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					rename alpha to beta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   0558a161e3ca0d59f5f165e3182402d9f1e574a8
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    8b8a0e87dfd7a0706c0524afa8ba67e20544cbf0
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Thu Jan 01 00:00:00 1970 +0000
 | 
				
			||||||
 | 
					files+:      alpha
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					add alpha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										27
									
								
								test/expected/symlink/log
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								test/expected/symlink/log
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
				
			|||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :1
 | 
				
			||||||
 | 
					data 6
 | 
				
			||||||
 | 
					alpha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					reset refs/heads/master
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :2
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					committer C O Mitter <committer@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					data 10
 | 
				
			||||||
 | 
					add alpha
 | 
				
			||||||
 | 
					M 100644 :1 alpha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					blob
 | 
				
			||||||
 | 
					mark :3
 | 
				
			||||||
 | 
					data 5
 | 
				
			||||||
 | 
					alpha
 | 
				
			||||||
 | 
					commit refs/heads/master
 | 
				
			||||||
 | 
					mark :4
 | 
				
			||||||
 | 
					author A U Thor <author@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					committer C O Mitter <committer@example.com> 1167600600 +0230
 | 
				
			||||||
 | 
					data 9
 | 
				
			||||||
 | 
					add beta
 | 
				
			||||||
 | 
					from :2
 | 
				
			||||||
 | 
					M 120000 :3 beta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										32
									
								
								test/expected/symlink/output
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								test/expected/symlink/output
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,32 @@
 | 
				
			|||||||
 | 
					changeset:   87cbc97576079d3dfef04c678bfc8ab69999ebdf
 | 
				
			||||||
 | 
					bookmark:    master
 | 
				
			||||||
 | 
					tag:         tip
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      362b656574c3c9e89fa7f2d7a943091dc93bce4d
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    4950f48a7f5b0ce6f31c2f4307e296dbac652026
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Mon Jan 01 00:00:00 2007 +0230
 | 
				
			||||||
 | 
					files+:      beta
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					extra:       committer=C O Mitter <committer@example.com> 1167600600 -9000
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					add beta
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					changeset:   362b656574c3c9e89fa7f2d7a943091dc93bce4d
 | 
				
			||||||
 | 
					phase:       draft
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					parent:      -0000000000000000000000000000000000000000
 | 
				
			||||||
 | 
					manifest:    8b8a0e87dfd7a0706c0524afa8ba67e20544cbf0
 | 
				
			||||||
 | 
					user:        A U Thor <author@example.com>
 | 
				
			||||||
 | 
					date:        Mon Jan 01 00:00:00 2007 +0230
 | 
				
			||||||
 | 
					files+:      alpha
 | 
				
			||||||
 | 
					extra:       branch=default
 | 
				
			||||||
 | 
					extra:       committer=C O Mitter <committer@example.com> 1167600600 -9000
 | 
				
			||||||
 | 
					description:
 | 
				
			||||||
 | 
					add alpha
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					644   alpha
 | 
				
			||||||
 | 
					644 @ beta
 | 
				
			||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
#!/bin/sh
 | 
					#!/bin/bash
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Copyright (c) 2016 Mark Nauwelaerts
 | 
					# Copyright (c) 2016 Mark Nauwelaerts
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
@@ -8,18 +8,11 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
test_description='Test git-hg-helper'
 | 
					test_description='Test git-hg-helper'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test -n "$TEST_DIRECTORY" || TEST_DIRECTORY=$(dirname $0)/
 | 
					. ./test-lib.sh
 | 
				
			||||||
. "$TEST_DIRECTORY"/test-lib.sh
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
if ! test_have_prereq PYTHON
 | 
					if ! test_have_prereq PYTHON
 | 
				
			||||||
then
 | 
					then
 | 
				
			||||||
	skip_all='skipping remote-hg tests; python not available'
 | 
						skip_all='skipping remote-hg tests; python with mercurial not available'
 | 
				
			||||||
	test_done
 | 
					 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
if ! python2 -c 'import mercurial' > /dev/null 2>&1
 | 
					 | 
				
			||||||
then
 | 
					 | 
				
			||||||
	skip_all='skipping remote-hg tests; mercurial not available'
 | 
					 | 
				
			||||||
	test_done
 | 
						test_done
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -521,8 +514,8 @@ test_expect_success 'subcommand sub status' '
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	(
 | 
						(
 | 
				
			||||||
	cd gitrepo &&
 | 
						cd gitrepo &&
 | 
				
			||||||
	git-hg-helper sub update sub_hg_a --force &&
 | 
						git-hg-helper sub update --force sub_hg_a  &&
 | 
				
			||||||
	git-hg-helper sub update sub_git --force &&
 | 
						git-hg-helper sub update --force sub_git &&
 | 
				
			||||||
		(
 | 
							(
 | 
				
			||||||
		# advance and add a tag to the git repo
 | 
							# advance and add a tag to the git repo
 | 
				
			||||||
		cd sub_git &&
 | 
							cd sub_git &&
 | 
				
			||||||
@@ -544,4 +537,4 @@ test_expect_success 'subcommand sub status' '
 | 
				
			|||||||
	)
 | 
						)
 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_done
 | 
					test_done
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										509
									
								
								test/hg-git.t
									
									
									
									
									
								
							
							
						
						
									
										509
									
								
								test/hg-git.t
									
									
									
									
									
								
							@@ -1,4 +1,4 @@
 | 
				
			|||||||
#!/bin/sh
 | 
					#!/bin/bash
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Copyright (c) 2012 Felipe Contreras
 | 
					# Copyright (c) 2012 Felipe Contreras
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
@@ -6,51 +6,24 @@
 | 
				
			|||||||
# https://bitbucket.org/durin42/hg-git/src
 | 
					# https://bitbucket.org/durin42/hg-git/src
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# shellcheck disable=SC2016,SC2034,SC2086,SC2164,SC1091
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_description='Test remote-hg output compared to hg-git'
 | 
					test_description='Test remote-hg output compared to hg-git'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test -n "$TEST_DIRECTORY" || TEST_DIRECTORY=$(dirname $0)/
 | 
					. ./test-lib.sh
 | 
				
			||||||
. "$TEST_DIRECTORY"/test-lib.sh
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
if ! test_have_prereq PYTHON
 | 
					export EXPECTED_DIR="$SHARNESS_TEST_DIRECTORY/expected"
 | 
				
			||||||
then
 | 
					 | 
				
			||||||
	skip_all='skipping remote-hg tests; python not available'
 | 
					 | 
				
			||||||
	test_done
 | 
					 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
if ! python2 -c 'import mercurial' > /dev/null 2>&1
 | 
					git_clone () {
 | 
				
			||||||
then
 | 
					 | 
				
			||||||
	skip_all='skipping remote-hg tests; mercurial not available'
 | 
					 | 
				
			||||||
	test_done
 | 
					 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
if python2 -c 'import hggit' > /dev/null 2>&1
 | 
					 | 
				
			||||||
then
 | 
					 | 
				
			||||||
	hggit=hggit
 | 
					 | 
				
			||||||
elif python2 -c 'import hgext.git' > /dev/null 2>&1
 | 
					 | 
				
			||||||
then
 | 
					 | 
				
			||||||
	hggit=hgext.git
 | 
					 | 
				
			||||||
else
 | 
					 | 
				
			||||||
	skip_all='skipping remote-hg tests; hg-git not available'
 | 
					 | 
				
			||||||
	test_done
 | 
					 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
hg_version=$(python2 -c 'from mercurial import util; print util.version()')
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
case $hg_version in
 | 
					 | 
				
			||||||
3.0*+*)
 | 
					 | 
				
			||||||
	skip_all='skipping remote-hg tests; unsuported version of hg by hg-git'
 | 
					 | 
				
			||||||
	test_done
 | 
					 | 
				
			||||||
	;;
 | 
					 | 
				
			||||||
esac
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# clone to a git repo with git
 | 
					 | 
				
			||||||
git_clone_git () {
 | 
					 | 
				
			||||||
	git clone -q "hg::$1" $2 &&
 | 
						git clone -q "hg::$1" $2 &&
 | 
				
			||||||
	(cd $2 && git checkout master && git branch -D default)
 | 
						(
 | 
				
			||||||
 | 
						cd $2 &&
 | 
				
			||||||
 | 
						git checkout master &&
 | 
				
			||||||
 | 
						{ git branch -D default || true ;}
 | 
				
			||||||
 | 
						)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# clone to an hg repo with git
 | 
					hg_clone () {
 | 
				
			||||||
hg_clone_git () {
 | 
					 | 
				
			||||||
	(
 | 
						(
 | 
				
			||||||
	hg init $2 &&
 | 
						hg init $2 &&
 | 
				
			||||||
	hg -R $2 bookmark -i master &&
 | 
						hg -R $2 bookmark -i master &&
 | 
				
			||||||
@@ -61,80 +34,112 @@ hg_clone_git () {
 | 
				
			|||||||
	(cd $2 && hg -q update)
 | 
						(cd $2 && hg -q update)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# clone to a git repo with hg
 | 
					hg_push () {
 | 
				
			||||||
git_clone_hg () {
 | 
					 | 
				
			||||||
	(
 | 
					 | 
				
			||||||
	git init -q $2 &&
 | 
					 | 
				
			||||||
	cd $1 &&
 | 
					 | 
				
			||||||
	hg bookmark -i -f -r tip master &&
 | 
					 | 
				
			||||||
	hg -q push -r master ../$2 || true
 | 
					 | 
				
			||||||
	)
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# clone to an hg repo with hg
 | 
					 | 
				
			||||||
hg_clone_hg () {
 | 
					 | 
				
			||||||
	hg -q clone $1 $2
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# push an hg repo with git
 | 
					 | 
				
			||||||
hg_push_git () {
 | 
					 | 
				
			||||||
	(
 | 
						(
 | 
				
			||||||
	cd $2
 | 
						cd $2
 | 
				
			||||||
	git checkout -q -b tmp &&
 | 
						git checkout -q -b tmp &&
 | 
				
			||||||
	git fetch -q "hg::../$1" 'refs/tags/*:refs/tags/*' 'refs/heads/*:refs/heads/*' &&
 | 
						git fetch -q "hg::../$1" 'refs/tags/*:refs/tags/*' 'refs/heads/*:refs/heads/*' &&
 | 
				
			||||||
	git branch -D default &&
 | 
						git branch -D default &&
 | 
				
			||||||
	git checkout -q @{-1} &&
 | 
						git checkout -q '@{-1}' &&
 | 
				
			||||||
	git branch -q -D tmp 2> /dev/null || true
 | 
						{ git branch -q -D tmp 2> /dev/null || true ;}
 | 
				
			||||||
	)
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# push an hg git repo with hg
 | 
					 | 
				
			||||||
hg_push_hg () {
 | 
					 | 
				
			||||||
	(
 | 
					 | 
				
			||||||
	cd $1 &&
 | 
					 | 
				
			||||||
	hg -q push ../$2 || true
 | 
					 | 
				
			||||||
	)
 | 
						)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
hg_log () {
 | 
					hg_log () {
 | 
				
			||||||
	hg -R $1 log --graph --debug > log &&
 | 
						hg -R $1 log --debug -r 'sort(tip:0, date)' |
 | 
				
			||||||
	grep -v 'tag: *default/' log
 | 
							sed -e '/tag: *default/d' -e 's/[0-9]\+:\([0-9a-f]\{40\}\)/\1/'
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
git_log () {
 | 
					git_log () {
 | 
				
			||||||
	git --git-dir=$1/.git fast-export --branches
 | 
						git -C $1 fast-export --branches
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test_cmp_expected () {
 | 
				
			||||||
 | 
						test_cmp "$EXPECTED_DIR/$test_id/$1" "$1"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					cmp_hg_to_git_log () {
 | 
				
			||||||
 | 
						hg_log hgrepo2 > hg-log &&
 | 
				
			||||||
 | 
						git_log gitrepo > git-log &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						test_cmp_expected hg-log &&
 | 
				
			||||||
 | 
						test_cmp_expected git-log
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					cmp_hg_to_git_log_hgrepo1 () {
 | 
				
			||||||
 | 
						git_clone hgrepo1 gitrepo &&
 | 
				
			||||||
 | 
						hg_clone gitrepo hgrepo2 &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						cmp_hg_to_git_log
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					cmp_hg_to_git_manifest () {
 | 
				
			||||||
 | 
						(
 | 
				
			||||||
 | 
						hg_clone gitrepo hgrepo &&
 | 
				
			||||||
 | 
						cd hgrepo &&
 | 
				
			||||||
 | 
						hg_log . &&
 | 
				
			||||||
 | 
						eval "$1"
 | 
				
			||||||
 | 
						) > output &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						git_clone hgrepo gitrepo2 &&
 | 
				
			||||||
 | 
						git_log gitrepo2 > log &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						test_cmp_expected output &&
 | 
				
			||||||
 | 
						test_cmp_expected log
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
setup () {
 | 
					setup () {
 | 
				
			||||||
	cat > "$HOME"/.hgrc <<-EOF &&
 | 
						cat > "$HOME"/.hgrc <<-EOF
 | 
				
			||||||
	[ui]
 | 
						[ui]
 | 
				
			||||||
	username = A U Thor <author@example.com>
 | 
						username = A U Thor <author@example.com>
 | 
				
			||||||
	[defaults]
 | 
						[defaults]
 | 
				
			||||||
	backout = -d "0 0"
 | 
					 | 
				
			||||||
	commit = -d "0 0"
 | 
						commit = -d "0 0"
 | 
				
			||||||
	debugrawcommit = -d "0 0"
 | 
					 | 
				
			||||||
	tag = -d "0 0"
 | 
						tag = -d "0 0"
 | 
				
			||||||
	[extensions]
 | 
					 | 
				
			||||||
	$hggit =
 | 
					 | 
				
			||||||
	graphlog =
 | 
					 | 
				
			||||||
	EOF
 | 
						EOF
 | 
				
			||||||
	git config --global receive.denycurrentbranch warn
 | 
					 | 
				
			||||||
	git config --global remote-hg.hg-git-compat true
 | 
					 | 
				
			||||||
	git config --global remote-hg.track-branches false
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	HGEDITOR=true
 | 
						cat > "$HOME"/.gitconfig <<-EOF
 | 
				
			||||||
	HGMERGE=true
 | 
						[remote-hg]
 | 
				
			||||||
 | 
							hg-git-compat = true
 | 
				
			||||||
 | 
							track-branches = false
 | 
				
			||||||
 | 
							# directly use local repo to avoid push (and hence phase issues)
 | 
				
			||||||
 | 
							shared-marks = false
 | 
				
			||||||
 | 
						EOF
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0230"
 | 
						export HGEDITOR=true
 | 
				
			||||||
	GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
 | 
						export HGMERGE=true
 | 
				
			||||||
	export HGEDITOR HGMERGE GIT_AUTHOR_DATE GIT_COMMITTER_DATE
 | 
					
 | 
				
			||||||
 | 
						export GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0230"
 | 
				
			||||||
 | 
						export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
setup
 | 
					setup
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_expect_success 'executable bit' '
 | 
					# save old function
 | 
				
			||||||
	test_when_finished "rm -rf gitrepo* hgrepo*" &&
 | 
					eval "old_$(declare -f test_expect_success)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test_expect_success () {
 | 
				
			||||||
 | 
						local req
 | 
				
			||||||
 | 
						test "$#" = 3 && { req=$1; shift; } || req=
 | 
				
			||||||
 | 
						test_id="$1"
 | 
				
			||||||
 | 
						old_test_expect_success "$req" "$1" "
 | 
				
			||||||
 | 
						test_when_finished \"rm -rf gitrepo* hgrepo*\" && $2"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test_expect_success 'rename' '
 | 
				
			||||||
 | 
						(
 | 
				
			||||||
 | 
						hg init hgrepo1 &&
 | 
				
			||||||
 | 
						cd hgrepo1 &&
 | 
				
			||||||
 | 
						echo alpha > alpha &&
 | 
				
			||||||
 | 
						hg add alpha &&
 | 
				
			||||||
 | 
						hg commit -m "add alpha" &&
 | 
				
			||||||
 | 
						hg mv alpha beta &&
 | 
				
			||||||
 | 
						hg commit -m "rename alpha to beta"
 | 
				
			||||||
 | 
						) &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						cmp_hg_to_git_log_hgrepo1
 | 
				
			||||||
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test_expect_success !WIN 'executable bit' '
 | 
				
			||||||
	(
 | 
						(
 | 
				
			||||||
	git init -q gitrepo &&
 | 
						git init -q gitrepo &&
 | 
				
			||||||
	cd gitrepo &&
 | 
						cd gitrepo &&
 | 
				
			||||||
@@ -150,27 +155,10 @@ test_expect_success 'executable bit' '
 | 
				
			|||||||
	git commit -m "clear executable bit"
 | 
						git commit -m "clear executable bit"
 | 
				
			||||||
	) &&
 | 
						) &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for x in hg git
 | 
						cmp_hg_to_git_manifest "hg manifest -v -r -1; hg manifest -v"
 | 
				
			||||||
	do
 | 
					 | 
				
			||||||
		(
 | 
					 | 
				
			||||||
		hg_clone_$x gitrepo hgrepo-$x &&
 | 
					 | 
				
			||||||
		cd hgrepo-$x &&
 | 
					 | 
				
			||||||
		hg_log . &&
 | 
					 | 
				
			||||||
		hg manifest -r 1 -v &&
 | 
					 | 
				
			||||||
		hg manifest -v
 | 
					 | 
				
			||||||
		) > "output-$x" &&
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		git_clone_$x hgrepo-$x gitrepo2-$x &&
 | 
					 | 
				
			||||||
		git_log gitrepo2-$x > "log-$x"
 | 
					 | 
				
			||||||
	done &&
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	test_cmp output-hg output-git &&
 | 
					 | 
				
			||||||
	test_cmp log-hg log-git
 | 
					 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_expect_success 'symlink' '
 | 
					test_expect_success !WIN 'symlink' '
 | 
				
			||||||
	test_when_finished "rm -rf gitrepo* hgrepo*" &&
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	(
 | 
						(
 | 
				
			||||||
	git init -q gitrepo &&
 | 
						git init -q gitrepo &&
 | 
				
			||||||
	cd gitrepo &&
 | 
						cd gitrepo &&
 | 
				
			||||||
@@ -182,26 +170,10 @@ test_expect_success 'symlink' '
 | 
				
			|||||||
	git commit -m "add beta"
 | 
						git commit -m "add beta"
 | 
				
			||||||
	) &&
 | 
						) &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for x in hg git
 | 
						cmp_hg_to_git_manifest "hg manifest -v"
 | 
				
			||||||
	do
 | 
					 | 
				
			||||||
		(
 | 
					 | 
				
			||||||
		hg_clone_$x gitrepo hgrepo-$x &&
 | 
					 | 
				
			||||||
		cd hgrepo-$x &&
 | 
					 | 
				
			||||||
		hg_log . &&
 | 
					 | 
				
			||||||
		hg manifest -v
 | 
					 | 
				
			||||||
		) > "output-$x" &&
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		git_clone_$x hgrepo-$x gitrepo2-$x &&
 | 
					 | 
				
			||||||
		git_log gitrepo2-$x > "log-$x"
 | 
					 | 
				
			||||||
	done &&
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	test_cmp output-hg output-git &&
 | 
					 | 
				
			||||||
	test_cmp log-hg log-git
 | 
					 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_expect_success 'merge conflict 1' '
 | 
					test_expect_success 'merge conflict 1' '
 | 
				
			||||||
	test_when_finished "rm -rf gitrepo* hgrepo*" &&
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	(
 | 
						(
 | 
				
			||||||
	hg init hgrepo1 &&
 | 
						hg init hgrepo1 &&
 | 
				
			||||||
	cd hgrepo1 &&
 | 
						cd hgrepo1 &&
 | 
				
			||||||
@@ -210,33 +182,22 @@ test_expect_success 'merge conflict 1' '
 | 
				
			|||||||
	hg ci -m "origin" &&
 | 
						hg ci -m "origin" &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	echo B > afile &&
 | 
						echo B > afile &&
 | 
				
			||||||
	hg ci -m "A->B" &&
 | 
						hg ci -m "A->B" -d "1 0" &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	hg up -r0 &&
 | 
						hg up -r0 &&
 | 
				
			||||||
	echo C > afile &&
 | 
						echo C > afile &&
 | 
				
			||||||
	hg ci -m "A->C" &&
 | 
						hg ci -m "A->C" -d "2 0" &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	hg merge -r1 &&
 | 
						hg merge -r1 &&
 | 
				
			||||||
	echo C > afile &&
 | 
						echo C > afile &&
 | 
				
			||||||
	hg resolve -m afile &&
 | 
						hg resolve -m afile &&
 | 
				
			||||||
	hg ci -m "merge to C"
 | 
						hg ci -m "merge to C" -d "3 0"
 | 
				
			||||||
	) &&
 | 
						) &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for x in hg git
 | 
						cmp_hg_to_git_log_hgrepo1
 | 
				
			||||||
	do
 | 
					 | 
				
			||||||
		git_clone_$x hgrepo1 gitrepo-$x &&
 | 
					 | 
				
			||||||
		hg_clone_$x gitrepo-$x hgrepo2-$x &&
 | 
					 | 
				
			||||||
		hg_log hgrepo2-$x > "hg-log-$x" &&
 | 
					 | 
				
			||||||
		git_log gitrepo-$x > "git-log-$x"
 | 
					 | 
				
			||||||
	done &&
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	test_cmp hg-log-hg hg-log-git &&
 | 
					 | 
				
			||||||
	test_cmp git-log-hg git-log-git
 | 
					 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_expect_success 'merge conflict 2' '
 | 
					test_expect_success 'merge conflict 2' '
 | 
				
			||||||
	test_when_finished "rm -rf gitrepo* hgrepo*" &&
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	(
 | 
						(
 | 
				
			||||||
	hg init hgrepo1 &&
 | 
						hg init hgrepo1 &&
 | 
				
			||||||
	cd hgrepo1 &&
 | 
						cd hgrepo1 &&
 | 
				
			||||||
@@ -245,33 +206,22 @@ test_expect_success 'merge conflict 2' '
 | 
				
			|||||||
	hg ci -m "origin" &&
 | 
						hg ci -m "origin" &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	echo B > afile &&
 | 
						echo B > afile &&
 | 
				
			||||||
	hg ci -m "A->B" &&
 | 
						hg ci -m "A->B" -d "1 0" &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	hg up -r0 &&
 | 
						hg up -r0 &&
 | 
				
			||||||
	echo C > afile &&
 | 
						echo C > afile &&
 | 
				
			||||||
	hg ci -m "A->C" &&
 | 
						hg ci -m "A->C" -d "2 0" &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	hg merge -r1 || true &&
 | 
						hg merge -r1 || true &&
 | 
				
			||||||
	echo B > afile &&
 | 
						echo B > afile &&
 | 
				
			||||||
	hg resolve -m afile &&
 | 
						hg resolve -m afile &&
 | 
				
			||||||
	hg ci -m "merge to B"
 | 
						hg ci -m "merge to B" -d "3 0"
 | 
				
			||||||
	) &&
 | 
						) &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for x in hg git
 | 
						cmp_hg_to_git_log_hgrepo1
 | 
				
			||||||
	do
 | 
					 | 
				
			||||||
		git_clone_$x hgrepo1 gitrepo-$x &&
 | 
					 | 
				
			||||||
		hg_clone_$x gitrepo-$x hgrepo2-$x &&
 | 
					 | 
				
			||||||
		hg_log hgrepo2-$x > "hg-log-$x" &&
 | 
					 | 
				
			||||||
		git_log gitrepo-$x > "git-log-$x"
 | 
					 | 
				
			||||||
	done &&
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	test_cmp hg-log-hg hg-log-git &&
 | 
					 | 
				
			||||||
	test_cmp git-log-hg git-log-git
 | 
					 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_expect_success 'converged merge' '
 | 
					test_expect_success 'converged merge' '
 | 
				
			||||||
	test_when_finished "rm -rf gitrepo* hgrepo*" &&
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	(
 | 
						(
 | 
				
			||||||
	hg init hgrepo1 &&
 | 
						hg init hgrepo1 &&
 | 
				
			||||||
	cd hgrepo1 &&
 | 
						cd hgrepo1 &&
 | 
				
			||||||
@@ -280,34 +230,23 @@ test_expect_success 'converged merge' '
 | 
				
			|||||||
	hg ci -m "origin" &&
 | 
						hg ci -m "origin" &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	echo B > afile &&
 | 
						echo B > afile &&
 | 
				
			||||||
	hg ci -m "A->B" &&
 | 
						hg ci -m "A->B" -d "1 0" &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	echo C > afile &&
 | 
						echo C > afile &&
 | 
				
			||||||
	hg ci -m "B->C" &&
 | 
						hg ci -m "B->C" -d "2 0" &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	hg up -r0 &&
 | 
						hg up -r0 &&
 | 
				
			||||||
	echo C > afile &&
 | 
						echo C > afile &&
 | 
				
			||||||
	hg ci -m "A->C" &&
 | 
						hg ci -m "A->C" -d "3 0" &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	hg merge -r2 || true &&
 | 
						hg merge -r2 || true &&
 | 
				
			||||||
	hg ci -m "merge"
 | 
						hg ci -m "merge" -d "4 0"
 | 
				
			||||||
	) &&
 | 
						) &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for x in hg git
 | 
						cmp_hg_to_git_log_hgrepo1
 | 
				
			||||||
	do
 | 
					 | 
				
			||||||
		git_clone_$x hgrepo1 gitrepo-$x &&
 | 
					 | 
				
			||||||
		hg_clone_$x gitrepo-$x hgrepo2-$x &&
 | 
					 | 
				
			||||||
		hg_log hgrepo2-$x > "hg-log-$x" &&
 | 
					 | 
				
			||||||
		git_log gitrepo-$x > "git-log-$x"
 | 
					 | 
				
			||||||
	done &&
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	test_cmp hg-log-hg hg-log-git &&
 | 
					 | 
				
			||||||
	test_cmp git-log-hg git-log-git
 | 
					 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_expect_success 'encoding' '
 | 
					test_expect_success 'encoding' '
 | 
				
			||||||
	test_when_finished "rm -rf gitrepo* hgrepo*" &&
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	(
 | 
						(
 | 
				
			||||||
	git init -q gitrepo &&
 | 
						git init -q gitrepo &&
 | 
				
			||||||
	cd gitrepo &&
 | 
						cd gitrepo &&
 | 
				
			||||||
@@ -332,22 +271,17 @@ test_expect_success 'encoding' '
 | 
				
			|||||||
	git commit -m "add déltà"
 | 
						git commit -m "add déltà"
 | 
				
			||||||
	) &&
 | 
						) &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for x in hg git
 | 
						hg_clone gitrepo hgrepo &&
 | 
				
			||||||
	do
 | 
						git_clone hgrepo gitrepo2 &&
 | 
				
			||||||
		hg_clone_$x gitrepo hgrepo-$x &&
 | 
					 | 
				
			||||||
		git_clone_$x hgrepo-$x gitrepo2-$x &&
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		HGENCODING=utf-8 hg_log hgrepo-$x > "hg-log-$x" &&
 | 
						HGENCODING=utf-8 hg_log hgrepo > hg-log &&
 | 
				
			||||||
		git_log gitrepo2-$x > "git-log-$x"
 | 
						git_log gitrepo2 > git-log &&
 | 
				
			||||||
	done &&
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	test_cmp hg-log-hg hg-log-git &&
 | 
						test_cmp_expected hg-log &&
 | 
				
			||||||
	test_cmp git-log-hg git-log-git
 | 
						test_cmp_expected git-log
 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_expect_success 'file removal' '
 | 
					test_expect_success 'file removal' '
 | 
				
			||||||
	test_when_finished "rm -rf gitrepo* hgrepo*" &&
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	(
 | 
						(
 | 
				
			||||||
	git init -q gitrepo &&
 | 
						git init -q gitrepo &&
 | 
				
			||||||
	cd gitrepo &&
 | 
						cd gitrepo &&
 | 
				
			||||||
@@ -367,27 +301,10 @@ test_expect_success 'file removal' '
 | 
				
			|||||||
	git commit -m "remove foo/bar"
 | 
						git commit -m "remove foo/bar"
 | 
				
			||||||
	) &&
 | 
						) &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for x in hg git
 | 
						cmp_hg_to_git_manifest "hg manifest -r 3; hg manifest"
 | 
				
			||||||
	do
 | 
					 | 
				
			||||||
		(
 | 
					 | 
				
			||||||
		hg_clone_$x gitrepo hgrepo-$x &&
 | 
					 | 
				
			||||||
		cd hgrepo-$x &&
 | 
					 | 
				
			||||||
		hg_log . &&
 | 
					 | 
				
			||||||
		hg manifest -r 3 &&
 | 
					 | 
				
			||||||
		hg manifest
 | 
					 | 
				
			||||||
		) > "output-$x" &&
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		git_clone_$x hgrepo-$x gitrepo2-$x &&
 | 
					 | 
				
			||||||
		git_log gitrepo2-$x > "log-$x"
 | 
					 | 
				
			||||||
	done &&
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	test_cmp output-hg output-git &&
 | 
					 | 
				
			||||||
	test_cmp log-hg log-git
 | 
					 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_expect_success 'git tags' '
 | 
					test_expect_success 'git tags' '
 | 
				
			||||||
	test_when_finished "rm -rf gitrepo* hgrepo*" &&
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	(
 | 
						(
 | 
				
			||||||
	git init -q gitrepo &&
 | 
						git init -q gitrepo &&
 | 
				
			||||||
	cd gitrepo &&
 | 
						cd gitrepo &&
 | 
				
			||||||
@@ -403,153 +320,127 @@ test_expect_success 'git tags' '
 | 
				
			|||||||
	git tag -a -m "added tag beta" beta
 | 
						git tag -a -m "added tag beta" beta
 | 
				
			||||||
	) &&
 | 
						) &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for x in hg git
 | 
						hg_clone gitrepo hgrepo &&
 | 
				
			||||||
	do
 | 
						hg_log hgrepo > log &&
 | 
				
			||||||
		hg_clone_$x gitrepo hgrepo-$x &&
 | 
					 | 
				
			||||||
		hg_log hgrepo-$x > "log-$x"
 | 
					 | 
				
			||||||
	done &&
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	test_cmp log-hg log-git
 | 
						test_cmp_expected log
 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_expect_success 'hg author' '
 | 
					test_expect_success 'hg author' '
 | 
				
			||||||
	test_when_finished "rm -rf gitrepo* hgrepo*" &&
 | 
						(
 | 
				
			||||||
 | 
						git init -q gitrepo &&
 | 
				
			||||||
 | 
						cd gitrepo &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for x in hg git
 | 
						echo alpha > alpha &&
 | 
				
			||||||
	do
 | 
						git add alpha &&
 | 
				
			||||||
		(
 | 
						git commit -m "add alpha" &&
 | 
				
			||||||
		git init -q gitrepo-$x &&
 | 
						git checkout -q -b not-master
 | 
				
			||||||
		cd gitrepo-$x &&
 | 
						) &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		echo alpha > alpha &&
 | 
						(
 | 
				
			||||||
		git add alpha &&
 | 
						hg_clone gitrepo hgrepo &&
 | 
				
			||||||
		git commit -m "add alpha" &&
 | 
						cd hgrepo &&
 | 
				
			||||||
		git checkout -q -b not-master
 | 
					 | 
				
			||||||
		) &&
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		(
 | 
						hg co master &&
 | 
				
			||||||
		hg_clone_$x gitrepo-$x hgrepo-$x &&
 | 
						echo beta > beta &&
 | 
				
			||||||
		cd hgrepo-$x &&
 | 
						hg add beta &&
 | 
				
			||||||
 | 
						hg commit -u "test" -m "add beta" &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		hg co master &&
 | 
						echo gamma >> beta &&
 | 
				
			||||||
		echo beta > beta &&
 | 
						hg commit -u "test <test@example.com> (comment)" -m "modify beta" &&
 | 
				
			||||||
		hg add beta &&
 | 
					 | 
				
			||||||
		hg commit -u "test" -m "add beta" &&
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		echo gamma >> beta &&
 | 
						echo gamma > gamma &&
 | 
				
			||||||
		hg commit -u "test <test@example.com> (comment)" -m "modify beta" &&
 | 
						hg add gamma &&
 | 
				
			||||||
 | 
						hg commit -u "<test@example.com>" -m "add gamma" &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		echo gamma > gamma &&
 | 
						echo delta > delta &&
 | 
				
			||||||
		hg add gamma &&
 | 
						hg add delta &&
 | 
				
			||||||
		hg commit -u "<test@example.com>" -m "add gamma" &&
 | 
						hg commit -u "name<test@example.com>" -m "add delta" &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		echo delta > delta &&
 | 
						echo epsilon > epsilon &&
 | 
				
			||||||
		hg add delta &&
 | 
						hg add epsilon &&
 | 
				
			||||||
		hg commit -u "name<test@example.com>" -m "add delta" &&
 | 
						hg commit -u "name <test@example.com" -m "add epsilon" &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		echo epsilon > epsilon &&
 | 
						echo zeta > zeta &&
 | 
				
			||||||
		hg add epsilon &&
 | 
						hg add zeta &&
 | 
				
			||||||
		hg commit -u "name <test@example.com" -m "add epsilon" &&
 | 
						hg commit -u " test " -m "add zeta" &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		echo zeta > zeta &&
 | 
						echo eta > eta &&
 | 
				
			||||||
		hg add zeta &&
 | 
						hg add eta &&
 | 
				
			||||||
		hg commit -u " test " -m "add zeta" &&
 | 
						hg commit -u "test < test@example.com >" -m "add eta" &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		echo eta > eta &&
 | 
						echo theta > theta &&
 | 
				
			||||||
		hg add eta &&
 | 
						hg add theta &&
 | 
				
			||||||
		hg commit -u "test < test@example.com >" -m "add eta" &&
 | 
						hg commit -u "test >test@example.com>" -m "add theta" &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		echo theta > theta &&
 | 
						echo iota > iota &&
 | 
				
			||||||
		hg add theta &&
 | 
						hg add iota &&
 | 
				
			||||||
		hg commit -u "test >test@example.com>" -m "add theta" &&
 | 
						hg commit -u "test <test <at> example <dot> com>" -m "add iota"
 | 
				
			||||||
 | 
						) &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		echo iota > iota &&
 | 
						hg_push hgrepo gitrepo &&
 | 
				
			||||||
		hg add iota &&
 | 
						hg_clone gitrepo hgrepo2 &&
 | 
				
			||||||
		hg commit -u "test <test <at> example <dot> com>" -m "add iota"
 | 
					 | 
				
			||||||
		) &&
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		hg_push_$x hgrepo-$x gitrepo-$x &&
 | 
						cmp_hg_to_git_log
 | 
				
			||||||
		hg_clone_$x gitrepo-$x hgrepo2-$x &&
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		hg_log hgrepo2-$x > "hg-log-$x" &&
 | 
					 | 
				
			||||||
		git_log gitrepo-$x > "git-log-$x"
 | 
					 | 
				
			||||||
	done &&
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	test_cmp hg-log-hg hg-log-git &&
 | 
					 | 
				
			||||||
	test_cmp git-log-hg git-log-git
 | 
					 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_expect_success 'hg branch' '
 | 
					test_expect_success 'hg branch' '
 | 
				
			||||||
	test_when_finished "rm -rf gitrepo* hgrepo*" &&
 | 
						(
 | 
				
			||||||
 | 
						git init -q gitrepo &&
 | 
				
			||||||
 | 
						cd gitrepo &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for x in hg git
 | 
						echo alpha > alpha &&
 | 
				
			||||||
	do
 | 
						git add alpha &&
 | 
				
			||||||
		(
 | 
						git commit -q -m "add alpha" &&
 | 
				
			||||||
		git init -q gitrepo-$x &&
 | 
						git checkout -q -b not-master
 | 
				
			||||||
		cd gitrepo-$x &&
 | 
						) &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		echo alpha > alpha &&
 | 
						(
 | 
				
			||||||
		git add alpha &&
 | 
						hg_clone gitrepo hgrepo &&
 | 
				
			||||||
		git commit -q -m "add alpha" &&
 | 
					 | 
				
			||||||
		git checkout -q -b not-master
 | 
					 | 
				
			||||||
		) &&
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		(
 | 
						cd hgrepo &&
 | 
				
			||||||
		hg_clone_$x gitrepo-$x hgrepo-$x &&
 | 
						hg -q co master &&
 | 
				
			||||||
 | 
						hg mv alpha beta &&
 | 
				
			||||||
 | 
						hg -q commit -m "rename alpha to beta" &&
 | 
				
			||||||
 | 
						hg branch gamma | grep -v "permanent and global" &&
 | 
				
			||||||
 | 
						hg -q commit -m "started branch gamma"
 | 
				
			||||||
 | 
						) &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		cd hgrepo-$x &&
 | 
						hg_push hgrepo gitrepo &&
 | 
				
			||||||
		hg -q co master &&
 | 
						hg_clone gitrepo hgrepo2 &&
 | 
				
			||||||
		hg mv alpha beta &&
 | 
					 | 
				
			||||||
		hg -q commit -m "rename alpha to beta" &&
 | 
					 | 
				
			||||||
		hg branch gamma | grep -v "permanent and global" &&
 | 
					 | 
				
			||||||
		hg -q commit -m "started branch gamma"
 | 
					 | 
				
			||||||
		) &&
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		hg_push_$x hgrepo-$x gitrepo-$x &&
 | 
						cmp_hg_to_git_log
 | 
				
			||||||
		hg_clone_$x gitrepo-$x hgrepo2-$x &&
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		hg_log hgrepo2-$x > "hg-log-$x" &&
 | 
					 | 
				
			||||||
		git_log gitrepo-$x > "git-log-$x"
 | 
					 | 
				
			||||||
	done &&
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	test_cmp hg-log-hg hg-log-git &&
 | 
					 | 
				
			||||||
	test_cmp git-log-hg git-log-git
 | 
					 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_expect_success 'hg tags' '
 | 
					test_expect_success 'hg tags' '
 | 
				
			||||||
	test_when_finished "rm -rf gitrepo* hgrepo*" &&
 | 
						(
 | 
				
			||||||
 | 
						git init -q gitrepo &&
 | 
				
			||||||
 | 
						cd gitrepo &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for x in hg git
 | 
						echo alpha > alpha &&
 | 
				
			||||||
	do
 | 
						git add alpha &&
 | 
				
			||||||
		(
 | 
						git commit -m "add alpha" &&
 | 
				
			||||||
		git init -q gitrepo-$x &&
 | 
						git checkout -q -b not-master
 | 
				
			||||||
		cd gitrepo-$x &&
 | 
						) &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		echo alpha > alpha &&
 | 
						(
 | 
				
			||||||
		git add alpha &&
 | 
						hg_clone gitrepo hgrepo &&
 | 
				
			||||||
		git commit -m "add alpha" &&
 | 
					 | 
				
			||||||
		git checkout -q -b not-master
 | 
					 | 
				
			||||||
		) &&
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		(
 | 
						cd hgrepo &&
 | 
				
			||||||
		hg_clone_$x gitrepo-$x hgrepo-$x &&
 | 
						hg co master &&
 | 
				
			||||||
 | 
						hg tag alpha
 | 
				
			||||||
 | 
						) &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		cd hgrepo-$x &&
 | 
						hg_push hgrepo gitrepo &&
 | 
				
			||||||
		hg co master &&
 | 
						hg_clone gitrepo hgrepo2 &&
 | 
				
			||||||
		hg tag alpha
 | 
					 | 
				
			||||||
		) &&
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		hg_push_$x hgrepo-$x gitrepo-$x &&
 | 
						(
 | 
				
			||||||
		hg_clone_$x gitrepo-$x hgrepo2-$x &&
 | 
						git -C gitrepo tag -l &&
 | 
				
			||||||
 | 
						hg_log hgrepo2 &&
 | 
				
			||||||
 | 
						cat hgrepo2/.hgtags
 | 
				
			||||||
 | 
						) > output &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		(
 | 
						test_cmp_expected output
 | 
				
			||||||
		git --git-dir=gitrepo-$x/.git tag -l &&
 | 
					 | 
				
			||||||
		hg_log hgrepo2-$x &&
 | 
					 | 
				
			||||||
		cat hgrepo2-$x/.hgtags
 | 
					 | 
				
			||||||
		) > "output-$x"
 | 
					 | 
				
			||||||
	done &&
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	test_cmp output-hg output-git
 | 
					 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_done
 | 
					test_done
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -270,10 +270,10 @@ test_expect_success 'push with renamed executable preserves executable bit' '
 | 
				
			|||||||
	) &&
 | 
						) &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	(
 | 
						(
 | 
				
			||||||
 | 
						umask 0 &&
 | 
				
			||||||
	cd hgrepo &&
 | 
						cd hgrepo &&
 | 
				
			||||||
	hg update &&
 | 
						hg update &&
 | 
				
			||||||
	stat content2 >expected &&
 | 
						stat content2 >expected &&
 | 
				
			||||||
	# umask mileage might vary
 | 
					 | 
				
			||||||
	grep -- -r.xr.xr.x expected
 | 
						grep -- -r.xr.xr.x expected
 | 
				
			||||||
	)
 | 
						)
 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										267
									
								
								test/main.t
									
									
									
									
									
								
							
							
						
						
									
										267
									
								
								test/main.t
									
									
									
									
									
								
							@@ -1,4 +1,4 @@
 | 
				
			|||||||
#!/bin/sh
 | 
					#!/bin/bash
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Copyright (c) 2012 Felipe Contreras
 | 
					# Copyright (c) 2012 Felipe Contreras
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
@@ -8,8 +8,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
test_description='Test remote-hg'
 | 
					test_description='Test remote-hg'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test -n "$TEST_DIRECTORY" || TEST_DIRECTORY=$(dirname $0)/
 | 
					. ./test-lib.sh
 | 
				
			||||||
. "$TEST_DIRECTORY"/test-lib.sh
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
if test "$CAPABILITY_PUSH" = "t"
 | 
					if test "$CAPABILITY_PUSH" = "t"
 | 
				
			||||||
then
 | 
					then
 | 
				
			||||||
@@ -20,18 +19,6 @@ else
 | 
				
			|||||||
	git config --global remote-hg.capability-push false
 | 
						git config --global remote-hg.capability-push false
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if ! test_have_prereq PYTHON
 | 
					 | 
				
			||||||
then
 | 
					 | 
				
			||||||
	skip_all='skipping remote-hg tests; python not available'
 | 
					 | 
				
			||||||
	test_done
 | 
					 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
if ! python2 -c 'import mercurial' > /dev/null 2>&1
 | 
					 | 
				
			||||||
then
 | 
					 | 
				
			||||||
	skip_all='skipping remote-hg tests; mercurial not available'
 | 
					 | 
				
			||||||
	test_done
 | 
					 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
check () {
 | 
					check () {
 | 
				
			||||||
	echo $3 > expected &&
 | 
						echo $3 > expected &&
 | 
				
			||||||
	git --git-dir=$1/.git log --format='%s' -1 $2 > actual &&
 | 
						git --git-dir=$1/.git log --format='%s' -1 $2 > actual &&
 | 
				
			||||||
@@ -96,14 +83,14 @@ check_push () {
 | 
				
			|||||||
		'')
 | 
							'')
 | 
				
			||||||
			grep "^   [a-f0-9]*\.\.[a-f0-9]* *${branch} -> ${branch}$" error || ref_ret=1
 | 
								grep "^   [a-f0-9]*\.\.[a-f0-9]* *${branch} -> ${branch}$" error || ref_ret=1
 | 
				
			||||||
			;;
 | 
								;;
 | 
				
			||||||
 | 
							*)
 | 
				
			||||||
 | 
								echo "BUG: wrong kind '$kind'" && return 3
 | 
				
			||||||
 | 
								;;
 | 
				
			||||||
		esac
 | 
							esac
 | 
				
			||||||
		test $ref_ret -ne 0 && echo "match for '$branch' failed" && break
 | 
							test $ref_ret -ne 0 && echo "match for '$branch' failed" && return 2
 | 
				
			||||||
	done
 | 
						done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if test $expected_ret -ne $ret || test $ref_ret -ne 0
 | 
						test $expected_ret -ne $ret && return 1
 | 
				
			||||||
	then
 | 
					 | 
				
			||||||
		return 1
 | 
					 | 
				
			||||||
	fi
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return 0
 | 
						return 0
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -519,7 +506,7 @@ else
 | 
				
			|||||||
test_expect_failure "$testcopyrenamedesc" "$testcopyrename"
 | 
					test_expect_failure "$testcopyrenamedesc" "$testcopyrename"
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_expect_success 'fetch special filenames' '
 | 
					test_expect_success !WIN '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=en_US.UTF-8
 | 
				
			||||||
@@ -658,16 +645,27 @@ test_expect_success 'remote big push' '
 | 
				
			|||||||
	(
 | 
						(
 | 
				
			||||||
	cd gitrepo &&
 | 
						cd gitrepo &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	check_push 1 --all <<-\EOF
 | 
						if test "$CAPABILITY_PUSH" = "t"
 | 
				
			||||||
	master
 | 
						then
 | 
				
			||||||
	good_bmark
 | 
							# cap push handles refs one by one
 | 
				
			||||||
	branches/good_branch
 | 
							# so it will still correctly report several ok
 | 
				
			||||||
	new_bmark:new
 | 
							check_push 1 --all <<-\EOF
 | 
				
			||||||
	branches/new_branch:new
 | 
							master
 | 
				
			||||||
	bad_bmark1:non-fast-forward
 | 
							good_bmark
 | 
				
			||||||
	bad_bmark2:non-fast-forward
 | 
							branches/good_branch
 | 
				
			||||||
	branches/bad_branch:non-fast-forward
 | 
							new_bmark:new
 | 
				
			||||||
	EOF
 | 
							branches/new_branch:new
 | 
				
			||||||
 | 
							bad_bmark1:non-fast-forward
 | 
				
			||||||
 | 
							bad_bmark2:non-fast-forward
 | 
				
			||||||
 | 
							branches/bad_branch:non-fast-forward
 | 
				
			||||||
 | 
							EOF
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							check_push 1 --all <<-\EOF
 | 
				
			||||||
 | 
							bad_bmark1:non-fast-forward
 | 
				
			||||||
 | 
							bad_bmark2:non-fast-forward
 | 
				
			||||||
 | 
							branches/bad_branch:non-fast-forward
 | 
				
			||||||
 | 
							EOF
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
	) &&
 | 
						) &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if test "$CAPABILITY_PUSH" = "t"
 | 
						if test "$CAPABILITY_PUSH" = "t"
 | 
				
			||||||
@@ -681,16 +679,18 @@ test_expect_success 'remote big push' '
 | 
				
			|||||||
		check_bookmark hgrepo good_bmark three &&
 | 
							check_bookmark hgrepo good_bmark three &&
 | 
				
			||||||
		check_bookmark hgrepo bad_bmark1 one &&
 | 
							check_bookmark hgrepo bad_bmark1 one &&
 | 
				
			||||||
		check_bookmark hgrepo bad_bmark2 one &&
 | 
							check_bookmark hgrepo bad_bmark2 one &&
 | 
				
			||||||
		check_bookmark hgrepo new_bmark six
 | 
							check_bookmark hgrepo new_bmark six &&
 | 
				
			||||||
 | 
							check gitrepo origin/master two
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		check_branch hgrepo default one &&
 | 
							check_branch hgrepo default one &&
 | 
				
			||||||
		check_branch hgrepo good_branch "good branch" &&
 | 
							check_branch hgrepo good_branch "good branch" &&
 | 
				
			||||||
		check_branch hgrepo bad_branch "bad branch" &&
 | 
							check_branch hgrepo bad_branch "bad branch" &&
 | 
				
			||||||
		check_branch hgrepo new_branch '' &&
 | 
							check_branch hgrepo new_branch &&
 | 
				
			||||||
		check_bookmark hgrepo good_bmark one &&
 | 
							check_bookmark hgrepo good_bmark one &&
 | 
				
			||||||
		check_bookmark hgrepo bad_bmark1 one &&
 | 
							check_bookmark hgrepo bad_bmark1 one &&
 | 
				
			||||||
		check_bookmark hgrepo bad_bmark2 one &&
 | 
							check_bookmark hgrepo bad_bmark2 one &&
 | 
				
			||||||
		check_bookmark hgrepo new_bmark ''
 | 
							check_bookmark hgrepo new_bmark &&
 | 
				
			||||||
 | 
							check gitrepo origin/master one
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -740,12 +740,21 @@ test_expect_success 'remote big push non fast forward' '
 | 
				
			|||||||
	echo five > content &&
 | 
						echo five > content &&
 | 
				
			||||||
	git commit -q -a -m five &&
 | 
						git commit -q -a -m five &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	check_push 1 --all <<-\EOF &&
 | 
						if test "$CAPABILITY_PUSH" = "t"
 | 
				
			||||||
	master
 | 
						then
 | 
				
			||||||
	good_bmark
 | 
							check_push 1 --all <<-\EOF
 | 
				
			||||||
	bad_bmark:non-fast-forward
 | 
							master
 | 
				
			||||||
	branches/bad_branch:non-fast-forward
 | 
							good_bmark
 | 
				
			||||||
	EOF
 | 
							bad_bmark:non-fast-forward
 | 
				
			||||||
 | 
							branches/bad_branch:non-fast-forward
 | 
				
			||||||
 | 
							EOF
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							# cap export now only report error cases
 | 
				
			||||||
 | 
							check_push 1 --all <<-\EOF
 | 
				
			||||||
 | 
							bad_bmark:non-fast-forward
 | 
				
			||||||
 | 
							branches/bad_branch:non-fast-forward
 | 
				
			||||||
 | 
							EOF
 | 
				
			||||||
 | 
						fi &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	git fetch &&
 | 
						git fetch &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -755,14 +764,12 @@ test_expect_success 'remote big push non fast forward' '
 | 
				
			|||||||
		# so it will already have pushed some above previously
 | 
							# so it will already have pushed some above previously
 | 
				
			||||||
		# (and master is a fake one that jumps around a bit)
 | 
							# (and master is a fake one that jumps around a bit)
 | 
				
			||||||
		check_push 1 --all <<-\EOF
 | 
							check_push 1 --all <<-\EOF
 | 
				
			||||||
		master:non-fast-forward
 | 
					 | 
				
			||||||
		bad_bmark:non-fast-forward
 | 
							bad_bmark:non-fast-forward
 | 
				
			||||||
		branches/bad_branch:non-fast-forward
 | 
							branches/bad_branch:non-fast-forward
 | 
				
			||||||
		EOF
 | 
							EOF
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
 | 
							# cap export now only report error cases
 | 
				
			||||||
		check_push 1 --all <<-\EOF
 | 
							check_push 1 --all <<-\EOF
 | 
				
			||||||
		master
 | 
					 | 
				
			||||||
		good_bmark
 | 
					 | 
				
			||||||
		bad_bmark:non-fast-forward
 | 
							bad_bmark:non-fast-forward
 | 
				
			||||||
		branches/bad_branch:non-fast-forward
 | 
							branches/bad_branch:non-fast-forward
 | 
				
			||||||
		EOF
 | 
							EOF
 | 
				
			||||||
@@ -770,7 +777,7 @@ test_expect_success 'remote big push non fast forward' '
 | 
				
			|||||||
	)
 | 
						)
 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_expect_failure 'remote big push force' '
 | 
					test_expect_success 'remote big push force' '
 | 
				
			||||||
	test_when_finished "rm -rf hgrepo gitrepo*" &&
 | 
						test_when_finished "rm -rf hgrepo gitrepo*" &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	setup_big_push
 | 
						setup_big_push
 | 
				
			||||||
@@ -778,19 +785,33 @@ test_expect_failure 'remote big push force' '
 | 
				
			|||||||
	(
 | 
						(
 | 
				
			||||||
	cd gitrepo &&
 | 
						cd gitrepo &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	check_push 0 --force --all <<-\EOF
 | 
						if test "$CAPABILITY_PUSH" = "t"
 | 
				
			||||||
	master
 | 
						then
 | 
				
			||||||
	good_bmark
 | 
							check_push 0 --force --all <<-\EOF
 | 
				
			||||||
	branches/good_branch
 | 
							master:forced-update
 | 
				
			||||||
	new_bmark:new
 | 
							good_bmark:forced-update
 | 
				
			||||||
	branches/new_branch:new
 | 
							branches/good_branch:forced-update
 | 
				
			||||||
	bad_bmark1:forced-update
 | 
							new_bmark:new
 | 
				
			||||||
	bad_bmark2:forced-update
 | 
							branches/new_branch:new
 | 
				
			||||||
	branches/bad_branch:forced-update
 | 
							bad_bmark1:forced-update
 | 
				
			||||||
	EOF
 | 
							bad_bmark2:forced-update
 | 
				
			||||||
 | 
							branches/bad_branch:forced-update
 | 
				
			||||||
 | 
							EOF
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							check_push 0 --force --all <<-\EOF
 | 
				
			||||||
 | 
							master
 | 
				
			||||||
 | 
							good_bmark
 | 
				
			||||||
 | 
							branches/good_branch
 | 
				
			||||||
 | 
							new_bmark:new
 | 
				
			||||||
 | 
							branches/new_branch:new
 | 
				
			||||||
 | 
							bad_bmark1:forced-update
 | 
				
			||||||
 | 
							bad_bmark2:forced-update
 | 
				
			||||||
 | 
							branches/bad_branch:forced-update
 | 
				
			||||||
 | 
							EOF
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
	) &&
 | 
						) &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	check_branch hgrepo default six &&
 | 
						check gitrepo origin/master two &&
 | 
				
			||||||
	check_branch hgrepo good_branch eight &&
 | 
						check_branch hgrepo good_branch eight &&
 | 
				
			||||||
	check_branch hgrepo bad_branch nine &&
 | 
						check_branch hgrepo bad_branch nine &&
 | 
				
			||||||
	check_branch hgrepo new_branch ten &&
 | 
						check_branch hgrepo new_branch ten &&
 | 
				
			||||||
@@ -808,16 +829,27 @@ test_expect_success 'remote big push dry-run' '
 | 
				
			|||||||
	(
 | 
						(
 | 
				
			||||||
	cd gitrepo &&
 | 
						cd gitrepo &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	check_push 1 --dry-run --all <<-\EOF &&
 | 
						if test "$CAPABILITY_PUSH" = "t"
 | 
				
			||||||
	master
 | 
						then
 | 
				
			||||||
	good_bmark
 | 
							# cap push handles refs one by one
 | 
				
			||||||
	branches/good_branch
 | 
							# so it will still correctly report several ok
 | 
				
			||||||
	new_bmark:new
 | 
							check_push 1 --dry-run --all <<-\EOF
 | 
				
			||||||
	branches/new_branch:new
 | 
							master
 | 
				
			||||||
	bad_bmark1:non-fast-forward
 | 
							good_bmark
 | 
				
			||||||
	bad_bmark2:non-fast-forward
 | 
							branches/good_branch
 | 
				
			||||||
	branches/bad_branch:non-fast-forward
 | 
							new_bmark:new
 | 
				
			||||||
	EOF
 | 
							branches/new_branch:new
 | 
				
			||||||
 | 
							bad_bmark1:non-fast-forward
 | 
				
			||||||
 | 
							bad_bmark2:non-fast-forward
 | 
				
			||||||
 | 
							branches/bad_branch:non-fast-forward
 | 
				
			||||||
 | 
							EOF
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							check_push 1 --dry-run --all <<-\EOF
 | 
				
			||||||
 | 
							bad_bmark1:non-fast-forward
 | 
				
			||||||
 | 
							bad_bmark2:non-fast-forward
 | 
				
			||||||
 | 
							branches/bad_branch:non-fast-forward
 | 
				
			||||||
 | 
							EOF
 | 
				
			||||||
 | 
						fi &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	check_push 0 --dry-run master good_bmark new_bmark branches/good_branch branches/new_branch <<-\EOF
 | 
						check_push 0 --dry-run master good_bmark new_bmark branches/good_branch branches/new_branch <<-\EOF
 | 
				
			||||||
	master
 | 
						master
 | 
				
			||||||
@@ -828,14 +860,60 @@ test_expect_success 'remote big push dry-run' '
 | 
				
			|||||||
	EOF
 | 
						EOF
 | 
				
			||||||
	) &&
 | 
						) &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						check gitrepo origin/master one &&
 | 
				
			||||||
	check_branch hgrepo default one &&
 | 
						check_branch hgrepo default one &&
 | 
				
			||||||
	check_branch hgrepo good_branch "good branch" &&
 | 
						check_branch hgrepo good_branch "good branch" &&
 | 
				
			||||||
	check_branch hgrepo bad_branch "bad branch" &&
 | 
						check_branch hgrepo bad_branch "bad branch" &&
 | 
				
			||||||
	check_branch hgrepo new_branch '' &&
 | 
						check_branch hgrepo new_branch &&
 | 
				
			||||||
	check_bookmark hgrepo good_bmark one &&
 | 
						check_bookmark hgrepo good_bmark one &&
 | 
				
			||||||
	check_bookmark hgrepo bad_bmark1 one &&
 | 
						check_bookmark hgrepo bad_bmark1 one &&
 | 
				
			||||||
	check_bookmark hgrepo bad_bmark2 one &&
 | 
						check_bookmark hgrepo bad_bmark2 one &&
 | 
				
			||||||
	check_bookmark hgrepo new_bmark ''
 | 
						check_bookmark hgrepo new_bmark
 | 
				
			||||||
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test_expect_success 'remote big push force dry-run' '
 | 
				
			||||||
 | 
						test_when_finished "rm -rf hgrepo gitrepo*" &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						setup_big_push
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						(
 | 
				
			||||||
 | 
						cd gitrepo &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if test "$CAPABILITY_PUSH" = "t"
 | 
				
			||||||
 | 
						then
 | 
				
			||||||
 | 
							check_push 0 --force --dry-run --all <<-\EOF
 | 
				
			||||||
 | 
							master:forced-update
 | 
				
			||||||
 | 
							good_bmark:forced-update
 | 
				
			||||||
 | 
							branches/good_branch:forced-update
 | 
				
			||||||
 | 
							new_bmark:new
 | 
				
			||||||
 | 
							branches/new_branch:new
 | 
				
			||||||
 | 
							bad_bmark1:forced-update
 | 
				
			||||||
 | 
							bad_bmark2:forced-update
 | 
				
			||||||
 | 
							branches/bad_branch:forced-update
 | 
				
			||||||
 | 
							EOF
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							check_push 0 --force --dry-run --all <<-\EOF
 | 
				
			||||||
 | 
							master
 | 
				
			||||||
 | 
							good_bmark
 | 
				
			||||||
 | 
							branches/good_branch
 | 
				
			||||||
 | 
							new_bmark:new
 | 
				
			||||||
 | 
							branches/new_branch:new
 | 
				
			||||||
 | 
							bad_bmark1:forced-update
 | 
				
			||||||
 | 
							bad_bmark2:forced-update
 | 
				
			||||||
 | 
							branches/bad_branch:forced-update
 | 
				
			||||||
 | 
							EOF
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
 | 
						) &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						check gitrepo origin/master one &&
 | 
				
			||||||
 | 
						check_branch hgrepo default one &&
 | 
				
			||||||
 | 
						check_branch hgrepo good_branch "good branch" &&
 | 
				
			||||||
 | 
						check_branch hgrepo bad_branch "bad branch" &&
 | 
				
			||||||
 | 
						check_branch hgrepo new_branch &&
 | 
				
			||||||
 | 
						check_bookmark hgrepo good_bmark one &&
 | 
				
			||||||
 | 
						check_bookmark hgrepo bad_bmark1 one &&
 | 
				
			||||||
 | 
						check_bookmark hgrepo bad_bmark2 one &&
 | 
				
			||||||
 | 
						check_bookmark hgrepo new_bmark
 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_expect_success 'remote double failed push' '
 | 
					test_expect_success 'remote double failed push' '
 | 
				
			||||||
@@ -995,7 +1073,7 @@ testpushupdatesnotes='
 | 
				
			|||||||
	(
 | 
						(
 | 
				
			||||||
	cd gitrepo &&
 | 
						cd gitrepo &&
 | 
				
			||||||
	echo two > content &&
 | 
						echo two > content &&
 | 
				
			||||||
	git commit -a -m two
 | 
						git commit -a -m two &&
 | 
				
			||||||
	git push
 | 
						git push
 | 
				
			||||||
	) &&
 | 
						) &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1081,7 +1159,7 @@ test_expect_success 'push merged named branch' '
 | 
				
			|||||||
	git push
 | 
						git push
 | 
				
			||||||
	) &&
 | 
						) &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	cat > expected <<-EOF
 | 
						cat > expected <<-EOF &&
 | 
				
			||||||
	Merge
 | 
						Merge
 | 
				
			||||||
	three
 | 
						three
 | 
				
			||||||
	two
 | 
						two
 | 
				
			||||||
@@ -1122,7 +1200,7 @@ test_expect_success 'push tag different branch' '
 | 
				
			|||||||
	cd hgrepo &&
 | 
						cd hgrepo &&
 | 
				
			||||||
	echo one > content &&
 | 
						echo one > content &&
 | 
				
			||||||
	hg add content &&
 | 
						hg add content &&
 | 
				
			||||||
	hg commit -m one
 | 
						hg commit -m one &&
 | 
				
			||||||
	hg branch feature &&
 | 
						hg branch feature &&
 | 
				
			||||||
	echo two > content &&
 | 
						echo two > content &&
 | 
				
			||||||
	hg commit -m two
 | 
						hg commit -m two
 | 
				
			||||||
@@ -1229,6 +1307,55 @@ test_expect_success 'clone can ignore invalid refnames' '
 | 
				
			|||||||
	check_files gitrepo "test.txt"
 | 
						check_files gitrepo "test.txt"
 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test_expect_success 'push annotated tag' '
 | 
				
			||||||
 | 
						test_when_finished "rm -rf hgrepo gitrepo" &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						(
 | 
				
			||||||
 | 
						hg init hgrepo &&
 | 
				
			||||||
 | 
						cd hgrepo &&
 | 
				
			||||||
 | 
						echo one > content &&
 | 
				
			||||||
 | 
						hg add content &&
 | 
				
			||||||
 | 
						hg commit -m one
 | 
				
			||||||
 | 
						) &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						(
 | 
				
			||||||
 | 
						git clone "hg::hgrepo" gitrepo &&
 | 
				
			||||||
 | 
						cd gitrepo &&
 | 
				
			||||||
 | 
						git tag -m "Version 1.0" v1.0 &&
 | 
				
			||||||
 | 
						git push --tags
 | 
				
			||||||
 | 
						) &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						cat > expected <<-\EOF &&
 | 
				
			||||||
 | 
						tip:Version 1.0:C O Mitter <committer@example.com>
 | 
				
			||||||
 | 
						v1.0:one:H G Wells <wells@example.com>
 | 
				
			||||||
 | 
						EOF
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						hg -R hgrepo log --template "{tags}:{desc}:{author}\n" > actual &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						test_cmp expected actual
 | 
				
			||||||
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test_expect_success 'timezone issues with negative offsets' '
 | 
				
			||||||
 | 
						test_when_finished "rm -rf hgrepo gitrepo1 gitrepo2" &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						hg init hgrepo &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						(
 | 
				
			||||||
 | 
						git clone "hg::hgrepo" gitrepo1 &&
 | 
				
			||||||
 | 
						cd gitrepo1 &&
 | 
				
			||||||
 | 
						echo two >> content &&
 | 
				
			||||||
 | 
						git add content &&
 | 
				
			||||||
 | 
						git commit -m two --date="2016-09-26 00:00:00 -0230" &&
 | 
				
			||||||
 | 
						git push
 | 
				
			||||||
 | 
						) &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						git clone "hg::hgrepo" gitrepo2 &&
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						git --git-dir=gitrepo1/.git log -1 --format="%ai" > expected &&
 | 
				
			||||||
 | 
						git --git-dir=gitrepo2/.git log -1 --format="%ai" > actual &&
 | 
				
			||||||
 | 
						test_cmp expected actual
 | 
				
			||||||
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if test "$CAPABILITY_PUSH" != "t"
 | 
					if test "$CAPABILITY_PUSH" != "t"
 | 
				
			||||||
then
 | 
					then
 | 
				
			||||||
test_done
 | 
					test_done
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										396
									
								
								test/sharness.sh
									
									
									
									
									
								
							
							
						
						
									
										396
									
								
								test/sharness.sh
									
									
									
									
									
								
							@@ -18,33 +18,80 @@
 | 
				
			|||||||
# along with this program.  If not, see http://www.gnu.org/licenses/ .
 | 
					# along with this program.  If not, see http://www.gnu.org/licenses/ .
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Public: Current version of Sharness.
 | 
					# Public: Current version of Sharness.
 | 
				
			||||||
SHARNESS_VERSION="0.3.0"
 | 
					SHARNESS_VERSION="1.1.0"
 | 
				
			||||||
export SHARNESS_VERSION
 | 
					export SHARNESS_VERSION
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Public: The file extension for tests.  By default, it is set to "t".
 | 
					# Public: The file extension for tests.  By default, it is set to "t".
 | 
				
			||||||
: ${SHARNESS_TEST_EXTENSION:=t}
 | 
					: "${SHARNESS_TEST_EXTENSION:=t}"
 | 
				
			||||||
export SHARNESS_TEST_EXTENSION
 | 
					export SHARNESS_TEST_EXTENSION
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Keep the original TERM for say_color
 | 
					# Public: Root directory containing tests. Tests can override this variable,
 | 
				
			||||||
ORIGINAL_TERM=$TERM
 | 
					# e.g. for testing Sharness itself.
 | 
				
			||||||
 | 
					if test -z "$SHARNESS_TEST_DIRECTORY"
 | 
				
			||||||
 | 
					then
 | 
				
			||||||
 | 
						SHARNESS_TEST_DIRECTORY=$(pwd)
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
						# ensure that SHARNESS_TEST_DIRECTORY is an absolute path so that it
 | 
				
			||||||
 | 
						# is valid even if the current working directory is changed
 | 
				
			||||||
 | 
						SHARNESS_TEST_DIRECTORY=$(cd "$SHARNESS_TEST_DIRECTORY" && pwd) || exit 1
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					export SHARNESS_TEST_DIRECTORY
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if test -z "$SHARNESS_TEST_OUTPUT_DIRECTORY"
 | 
				
			||||||
 | 
					then
 | 
				
			||||||
 | 
						# Similarly, override this to store the test-results subdir
 | 
				
			||||||
 | 
						# elsewhere
 | 
				
			||||||
 | 
						SHARNESS_TEST_OUTPUT_DIRECTORY=$SHARNESS_TEST_DIRECTORY
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#  Reset TERM to original terminal if found, otherwise save original TERM
 | 
				
			||||||
 | 
					[ "x" = "x$SHARNESS_ORIG_TERM" ] &&
 | 
				
			||||||
 | 
							SHARNESS_ORIG_TERM="$TERM" ||
 | 
				
			||||||
 | 
							TERM="$SHARNESS_ORIG_TERM"
 | 
				
			||||||
 | 
					# Public: The unsanitized TERM under which sharness is originally run
 | 
				
			||||||
 | 
					export SHARNESS_ORIG_TERM
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Export SHELL_PATH
 | 
				
			||||||
 | 
					: "${SHELL_PATH:=$SHELL}"
 | 
				
			||||||
 | 
					export SHELL_PATH
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# if --tee was passed, write the output not only to the terminal, but
 | 
				
			||||||
 | 
					# additionally to the file test-results/$BASENAME.out, too.
 | 
				
			||||||
 | 
					case "$SHARNESS_TEST_TEE_STARTED, $* " in
 | 
				
			||||||
 | 
					done,*)
 | 
				
			||||||
 | 
						# do not redirect again
 | 
				
			||||||
 | 
						;;
 | 
				
			||||||
 | 
					*' --tee '*|*' --verbose-log '*)
 | 
				
			||||||
 | 
						mkdir -p "$SHARNESS_TEST_OUTPUT_DIRECTORY/test-results"
 | 
				
			||||||
 | 
						BASE="$SHARNESS_TEST_OUTPUT_DIRECTORY/test-results/$(basename "$0" ".$SHARNESS_TEST_EXTENSION")"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						# Make this filename available to the sub-process in case it is using
 | 
				
			||||||
 | 
						# --verbose-log.
 | 
				
			||||||
 | 
						SHARNESS_TEST_TEE_OUTPUT_FILE="$BASE.out"
 | 
				
			||||||
 | 
						export SHARNESS_TEST_TEE_OUTPUT_FILE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						# Truncate before calling "tee -a" to get rid of the results
 | 
				
			||||||
 | 
						# from any previous runs.
 | 
				
			||||||
 | 
						: >"$SHARNESS_TEST_TEE_OUTPUT_FILE"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						(SHARNESS_TEST_TEE_STARTED="done" ${SHELL_PATH} "$0" "$@" 2>&1;
 | 
				
			||||||
 | 
						 echo $? >"$BASE.exit") | tee -a "$SHARNESS_TEST_TEE_OUTPUT_FILE"
 | 
				
			||||||
 | 
						test "$(cat "$BASE.exit")" = 0
 | 
				
			||||||
 | 
						exit
 | 
				
			||||||
 | 
						;;
 | 
				
			||||||
 | 
					esac
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# For repeatability, reset the environment to a known state.
 | 
					# For repeatability, reset the environment to a known state.
 | 
				
			||||||
 | 
					# TERM is sanitized below, after saving color control sequences.
 | 
				
			||||||
LANG=C
 | 
					LANG=C
 | 
				
			||||||
LC_ALL=C
 | 
					LC_ALL=C
 | 
				
			||||||
PAGER=cat
 | 
					PAGER="cat"
 | 
				
			||||||
TZ=UTC
 | 
					TZ=UTC
 | 
				
			||||||
TERM=dumb
 | 
					 | 
				
			||||||
EDITOR=:
 | 
					EDITOR=:
 | 
				
			||||||
export LANG LC_ALL PAGER TZ TERM EDITOR
 | 
					export LANG LC_ALL PAGER TZ EDITOR
 | 
				
			||||||
unset VISUAL CDPATH GREP_OPTIONS
 | 
					unset VISUAL CDPATH GREP_OPTIONS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Line feed
 | 
					[ "x$TERM" != "xdumb" ] && (
 | 
				
			||||||
LF='
 | 
					 | 
				
			||||||
'
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
[ "x$ORIGINAL_TERM" != "xdumb" ] && (
 | 
					 | 
				
			||||||
		TERM=$ORIGINAL_TERM &&
 | 
					 | 
				
			||||||
		export TERM &&
 | 
					 | 
				
			||||||
		[ -t 1 ] &&
 | 
							[ -t 1 ] &&
 | 
				
			||||||
		tput bold >/dev/null 2>&1 &&
 | 
							tput bold >/dev/null 2>&1 &&
 | 
				
			||||||
		tput setaf 1 >/dev/null 2>&1 &&
 | 
							tput setaf 1 >/dev/null 2>&1 &&
 | 
				
			||||||
@@ -60,6 +107,8 @@ while test "$#" -ne 0; do
 | 
				
			|||||||
		immediate=t; shift ;;
 | 
							immediate=t; shift ;;
 | 
				
			||||||
	-l|--l|--lo|--lon|--long|--long-|--long-t|--long-te|--long-tes|--long-test|--long-tests)
 | 
						-l|--l|--lo|--lon|--long|--long-|--long-t|--long-te|--long-tes|--long-test|--long-tests)
 | 
				
			||||||
		TEST_LONG=t; export TEST_LONG; shift ;;
 | 
							TEST_LONG=t; export TEST_LONG; shift ;;
 | 
				
			||||||
 | 
						--in|--int|--inte|--inter|--intera|--interac|--interact|--interacti|--interactiv|--interactive|--interactive-|--interactive-t|--interactive-te|--interactive-tes|--interactive-test|--interactive-tests):
 | 
				
			||||||
 | 
							TEST_INTERACTIVE=t; export TEST_INTERACTIVE; verbose=t; shift ;;
 | 
				
			||||||
	-h|--h|--he|--hel|--help)
 | 
						-h|--h|--he|--hel|--help)
 | 
				
			||||||
		help=t; shift ;;
 | 
							help=t; shift ;;
 | 
				
			||||||
	-v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
 | 
						-v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
 | 
				
			||||||
@@ -68,49 +117,69 @@ while test "$#" -ne 0; do
 | 
				
			|||||||
		# Ignore --quiet under a TAP::Harness. Saying how many tests
 | 
							# Ignore --quiet under a TAP::Harness. Saying how many tests
 | 
				
			||||||
		# passed without the ok/not ok details is always an error.
 | 
							# passed without the ok/not ok details is always an error.
 | 
				
			||||||
		test -z "$HARNESS_ACTIVE" && quiet=t; shift ;;
 | 
							test -z "$HARNESS_ACTIVE" && quiet=t; shift ;;
 | 
				
			||||||
 | 
						--chain-lint)
 | 
				
			||||||
 | 
							chain_lint=t; shift ;;
 | 
				
			||||||
 | 
						--no-chain-lint)
 | 
				
			||||||
 | 
							chain_lint=; shift ;;
 | 
				
			||||||
	--no-color)
 | 
						--no-color)
 | 
				
			||||||
		color=; shift ;;
 | 
							color=; shift ;;
 | 
				
			||||||
 | 
						--tee)
 | 
				
			||||||
 | 
							shift ;; # was handled already
 | 
				
			||||||
	--root=*)
 | 
						--root=*)
 | 
				
			||||||
		root=$(expr "z$1" : 'z[^=]*=\(.*\)')
 | 
							root=$(expr "z$1" : 'z[^=]*=\(.*\)')
 | 
				
			||||||
		shift ;;
 | 
							shift ;;
 | 
				
			||||||
 | 
						--verbose-log)
 | 
				
			||||||
 | 
							verbose_log=t
 | 
				
			||||||
 | 
							shift ;;
 | 
				
			||||||
	*)
 | 
						*)
 | 
				
			||||||
		echo "error: unknown test option '$1'" >&2; exit 1 ;;
 | 
							echo "error: unknown test option '$1'" >&2; exit 1 ;;
 | 
				
			||||||
	esac
 | 
						esac
 | 
				
			||||||
done
 | 
					done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if test -n "$color"; then
 | 
					if test -n "$color"; then
 | 
				
			||||||
 | 
						# Save the color control sequences now rather than run tput
 | 
				
			||||||
 | 
						# each time say_color() is called.  This is done for two
 | 
				
			||||||
 | 
						# reasons:
 | 
				
			||||||
 | 
						#   * TERM will be changed to dumb
 | 
				
			||||||
 | 
						#   * HOME will be changed to a temporary directory and tput
 | 
				
			||||||
 | 
						#     might need to read ~/.terminfo from the original HOME
 | 
				
			||||||
 | 
						#     directory to get the control sequences
 | 
				
			||||||
 | 
						# Note:  This approach assumes the control sequences don't end
 | 
				
			||||||
 | 
						# in a newline for any terminal of interest (command
 | 
				
			||||||
 | 
						# substitutions strip trailing newlines).  Given that most
 | 
				
			||||||
 | 
						# (all?) terminals in common use are related to ECMA-48, this
 | 
				
			||||||
 | 
						# shouldn't be a problem.
 | 
				
			||||||
 | 
						say_color_error=$(tput bold; tput setaf 1) # bold red
 | 
				
			||||||
 | 
						say_color_skip=$(tput setaf 4) # blue
 | 
				
			||||||
 | 
						say_color_warn=$(tput setaf 3) # brown/yellow
 | 
				
			||||||
 | 
						say_color_pass=$(tput setaf 2) # green
 | 
				
			||||||
 | 
						say_color_info=$(tput setaf 6) # cyan
 | 
				
			||||||
 | 
						say_color_reset=$(tput sgr0)
 | 
				
			||||||
 | 
						say_color_raw="" # no formatting for normal text
 | 
				
			||||||
	say_color() {
 | 
						say_color() {
 | 
				
			||||||
		(
 | 
							test -z "$1" && test -n "$quiet" && return
 | 
				
			||||||
		TERM=$ORIGINAL_TERM
 | 
					 | 
				
			||||||
		export TERM
 | 
					 | 
				
			||||||
		case "$1" in
 | 
							case "$1" in
 | 
				
			||||||
		error)
 | 
								error) say_color_color=$say_color_error ;;
 | 
				
			||||||
			tput bold; tput setaf 1;; # bold red
 | 
								skip) say_color_color=$say_color_skip ;;
 | 
				
			||||||
		skip)
 | 
								warn) say_color_color=$say_color_warn ;;
 | 
				
			||||||
			tput setaf 4;; # blue
 | 
								pass) say_color_color=$say_color_pass ;;
 | 
				
			||||||
		warn)
 | 
								info) say_color_color=$say_color_info ;;
 | 
				
			||||||
			tput setaf 3;; # brown/yellow
 | 
								*) say_color_color=$say_color_raw ;;
 | 
				
			||||||
		pass)
 | 
					 | 
				
			||||||
			tput setaf 2;; # green
 | 
					 | 
				
			||||||
		info)
 | 
					 | 
				
			||||||
			tput setaf 6;; # cyan
 | 
					 | 
				
			||||||
		*)
 | 
					 | 
				
			||||||
			test -n "$quiet" && return;;
 | 
					 | 
				
			||||||
		esac
 | 
							esac
 | 
				
			||||||
		shift
 | 
							shift
 | 
				
			||||||
		printf "%s" "$*"
 | 
							printf '%s%s%s\n' "$say_color_color" "$*" "$say_color_reset"
 | 
				
			||||||
		tput sgr0
 | 
					 | 
				
			||||||
		echo
 | 
					 | 
				
			||||||
		)
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
	say_color() {
 | 
						say_color() {
 | 
				
			||||||
		test -z "$1" && test -n "$quiet" && return
 | 
							test -z "$1" && test -n "$quiet" && return
 | 
				
			||||||
		shift
 | 
							shift
 | 
				
			||||||
		printf "%s\n" "$*"
 | 
							printf '%s\n' "$*"
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TERM=dumb
 | 
				
			||||||
 | 
					export TERM
 | 
				
			||||||
 | 
					
 | 
				
			||||||
error() {
 | 
					error() {
 | 
				
			||||||
	say_color error "error: $*"
 | 
						say_color error "error: $*"
 | 
				
			||||||
	EXIT_OK=t
 | 
						EXIT_OK=t
 | 
				
			||||||
@@ -121,7 +190,7 @@ say() {
 | 
				
			|||||||
	say_color info "$*"
 | 
						say_color info "$*"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test -n "$test_description" || error "Test script did not set test_description."
 | 
					test -n "${test_description:-}" || error "Test script did not set test_description."
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if test "$help" = "t"; then
 | 
					if test "$help" = "t"; then
 | 
				
			||||||
	echo "$test_description"
 | 
						echo "$test_description"
 | 
				
			||||||
@@ -130,7 +199,11 @@ fi
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
exec 5>&1
 | 
					exec 5>&1
 | 
				
			||||||
exec 6<&0
 | 
					exec 6<&0
 | 
				
			||||||
if test "$verbose" = "t"; then
 | 
					if test "$verbose_log" = "t"
 | 
				
			||||||
 | 
					then
 | 
				
			||||||
 | 
						exec 3>>"$SHARNESS_TEST_TEE_OUTPUT_FILE" 4>&3
 | 
				
			||||||
 | 
					elif test "$verbose" = "t"
 | 
				
			||||||
 | 
					then
 | 
				
			||||||
	exec 4>&2 3>&1
 | 
						exec 4>&2 3>&1
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
	exec 4>/dev/null 3>/dev/null
 | 
						exec 4>/dev/null 3>/dev/null
 | 
				
			||||||
@@ -161,7 +234,7 @@ trap 'die' EXIT
 | 
				
			|||||||
# implicitly by specifying the prerequisite name in calls to test_expect_success
 | 
					# implicitly by specifying the prerequisite name in calls to test_expect_success
 | 
				
			||||||
# or test_expect_failure.
 | 
					# or test_expect_failure.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# $1 - Name of prerequiste (a simple word, in all capital letters by convention)
 | 
					# $1 - Name of prerequisite (a simple word, in all capital letters by convention)
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Examples
 | 
					# Examples
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
@@ -198,7 +271,7 @@ test_have_prereq() {
 | 
				
			|||||||
	# prerequisites can be concatenated with ','
 | 
						# prerequisites can be concatenated with ','
 | 
				
			||||||
	save_IFS=$IFS
 | 
						save_IFS=$IFS
 | 
				
			||||||
	IFS=,
 | 
						IFS=,
 | 
				
			||||||
	set -- $*
 | 
						set -- $@
 | 
				
			||||||
	IFS=$save_IFS
 | 
						IFS=$save_IFS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	total_prereq=0
 | 
						total_prereq=0
 | 
				
			||||||
@@ -215,7 +288,7 @@ test_have_prereq() {
 | 
				
			|||||||
			negative_prereq=
 | 
								negative_prereq=
 | 
				
			||||||
		esac
 | 
							esac
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		total_prereq=$(($total_prereq + 1))
 | 
							total_prereq=$((total_prereq + 1))
 | 
				
			||||||
		case "$satisfied_prereq" in
 | 
							case "$satisfied_prereq" in
 | 
				
			||||||
		*" $prerequisite "*)
 | 
							*" $prerequisite "*)
 | 
				
			||||||
			satisfied_this_prereq=t
 | 
								satisfied_this_prereq=t
 | 
				
			||||||
@@ -226,7 +299,7 @@ test_have_prereq() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		case "$satisfied_this_prereq,$negative_prereq" in
 | 
							case "$satisfied_this_prereq,$negative_prereq" in
 | 
				
			||||||
		t,|,t)
 | 
							t,|,t)
 | 
				
			||||||
			ok_prereq=$(($ok_prereq + 1))
 | 
								ok_prereq=$((ok_prereq + 1))
 | 
				
			||||||
			;;
 | 
								;;
 | 
				
			||||||
		*)
 | 
							*)
 | 
				
			||||||
			# Keep a list of missing prerequisites; restore
 | 
								# Keep a list of missing prerequisites; restore
 | 
				
			||||||
@@ -247,12 +320,12 @@ test_have_prereq() {
 | 
				
			|||||||
# the text_expect_* functions instead.
 | 
					# the text_expect_* functions instead.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_ok_() {
 | 
					test_ok_() {
 | 
				
			||||||
	test_success=$(($test_success + 1))
 | 
						test_success=$((test_success + 1))
 | 
				
			||||||
	say_color "" "ok $test_count - $@"
 | 
						say_color "" "ok $test_count - $*"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_failure_() {
 | 
					test_failure_() {
 | 
				
			||||||
	test_failure=$(($test_failure + 1))
 | 
						test_failure=$((test_failure + 1))
 | 
				
			||||||
	say_color error "not ok $test_count - $1"
 | 
						say_color error "not ok $test_count - $1"
 | 
				
			||||||
	shift
 | 
						shift
 | 
				
			||||||
	echo "$@" | sed -e 's/^/#	/'
 | 
						echo "$@" | sed -e 's/^/#	/'
 | 
				
			||||||
@@ -260,13 +333,13 @@ test_failure_() {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_known_broken_ok_() {
 | 
					test_known_broken_ok_() {
 | 
				
			||||||
	test_fixed=$(($test_fixed + 1))
 | 
						test_fixed=$((test_fixed + 1))
 | 
				
			||||||
	say_color error "ok $test_count - $@ # TODO known breakage vanished"
 | 
						say_color error "ok $test_count - $* # TODO known breakage vanished"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_known_broken_failure_() {
 | 
					test_known_broken_failure_() {
 | 
				
			||||||
	test_broken=$(($test_broken + 1))
 | 
						test_broken=$((test_broken + 1))
 | 
				
			||||||
	say_color warn "not ok $test_count - $@ # TODO known breakage"
 | 
						say_color warn "not ok $test_count - $* # TODO known breakage"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Public: Execute commands in debug mode.
 | 
					# Public: Execute commands in debug mode.
 | 
				
			||||||
@@ -287,10 +360,29 @@ test_debug() {
 | 
				
			|||||||
	test "$debug" = "" || eval "$1"
 | 
						test "$debug" = "" || eval "$1"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Public: Stop execution and start a shell.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# This is useful for debugging tests and only makes sense together with "-v".
 | 
				
			||||||
 | 
					# Be sure to remove all invocations of this command before submitting.
 | 
				
			||||||
 | 
					test_pause() {
 | 
				
			||||||
 | 
						if test "$verbose" = t; then
 | 
				
			||||||
 | 
							"$SHELL_PATH" <&6 >&3 2>&4
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							error >&5 "test_pause requires --verbose"
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_eval_() {
 | 
					test_eval_() {
 | 
				
			||||||
	# This is a separate function because some tests use
 | 
						# This is a separate function because some tests use
 | 
				
			||||||
	# "return" to end a test_expect_success block early.
 | 
						# "return" to end a test_expect_success block early.
 | 
				
			||||||
	eval </dev/null >&3 2>&4 "$*"
 | 
						case ",$test_prereq," in
 | 
				
			||||||
 | 
						*,INTERACTIVE,*)
 | 
				
			||||||
 | 
							eval "$*"
 | 
				
			||||||
 | 
							;;
 | 
				
			||||||
 | 
						*)
 | 
				
			||||||
 | 
							eval </dev/null >&3 2>&4 "$*"
 | 
				
			||||||
 | 
							;;
 | 
				
			||||||
 | 
						esac
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_run_() {
 | 
					test_run_() {
 | 
				
			||||||
@@ -299,6 +391,13 @@ test_run_() {
 | 
				
			|||||||
	test_eval_ "$1"
 | 
						test_eval_ "$1"
 | 
				
			||||||
	eval_ret=$?
 | 
						eval_ret=$?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if test "$chain_lint" = "t"; then
 | 
				
			||||||
 | 
							test_eval_ "(exit 117) && $1"
 | 
				
			||||||
 | 
							if test "$?" != 117; then
 | 
				
			||||||
 | 
								error "bug in the test script: broken &&-chain: $1"
 | 
				
			||||||
 | 
							fi
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if test -z "$immediate" || test $eval_ret = 0 || test -n "$expecting_failure"; then
 | 
						if test -z "$immediate" || test $eval_ret = 0 || test -n "$expecting_failure"; then
 | 
				
			||||||
		test_eval_ "$test_cleanup"
 | 
							test_eval_ "$test_cleanup"
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
@@ -309,7 +408,7 @@ test_run_() {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_skip_() {
 | 
					test_skip_() {
 | 
				
			||||||
	test_count=$(($test_count + 1))
 | 
						test_count=$((test_count + 1))
 | 
				
			||||||
	to_skip=
 | 
						to_skip=
 | 
				
			||||||
	for skp in $SKIP_TESTS; do
 | 
						for skp in $SKIP_TESTS; do
 | 
				
			||||||
		case $this_test.$test_count in
 | 
							case $this_test.$test_count in
 | 
				
			||||||
@@ -328,7 +427,7 @@ test_skip_() {
 | 
				
			|||||||
			of_prereq=" of $test_prereq"
 | 
								of_prereq=" of $test_prereq"
 | 
				
			||||||
		fi
 | 
							fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		say_color skip >&3 "skipping test: $@"
 | 
							say_color skip >&3 "skipping test: $*"
 | 
				
			||||||
		say_color skip "ok $test_count # skip $1 (missing $missing_prereq${of_prereq})"
 | 
							say_color skip "ok $test_count # skip $1 (missing $missing_prereq${of_prereq})"
 | 
				
			||||||
		: true
 | 
							: true
 | 
				
			||||||
		;;
 | 
							;;
 | 
				
			||||||
@@ -426,6 +525,44 @@ test_expect_failure() {
 | 
				
			|||||||
	echo >&3 ""
 | 
						echo >&3 ""
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Public: Run test commands and expect anything from them. Used when a
 | 
				
			||||||
 | 
					# test is not stable or not finished for some reason.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# When the test passed, an "ok" message is printed, but the number of
 | 
				
			||||||
 | 
					# fixed tests is not incremented.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# When it failed, a "not ok ... # TODO known breakage" message is
 | 
				
			||||||
 | 
					# printed, and the number of tests still broken is incremented.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Failures from these tests won't cause --immediate to stop.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Usually takes two arguments:
 | 
				
			||||||
 | 
					# $1 - Test description
 | 
				
			||||||
 | 
					# $2 - Commands to be executed.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# With three arguments, the first will be taken to be a prerequisite:
 | 
				
			||||||
 | 
					# $1 - Comma-separated list of test prerequisites. The test will be skipped if
 | 
				
			||||||
 | 
					#      not all of the given prerequisites are set. To negate a prerequisite,
 | 
				
			||||||
 | 
					#      put a "!" in front of it.
 | 
				
			||||||
 | 
					# $2 - Test description
 | 
				
			||||||
 | 
					# $3 - Commands to be executed.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Returns nothing.
 | 
				
			||||||
 | 
					test_expect_unstable() {
 | 
				
			||||||
 | 
						test "$#" = 3 && { test_prereq=$1; shift; } || test_prereq=
 | 
				
			||||||
 | 
						test "$#" = 2 || error "bug in the test script: not 2 or 3 parameters to test_expect_unstable"
 | 
				
			||||||
 | 
						export test_prereq
 | 
				
			||||||
 | 
						if ! test_skip_ "$@"; then
 | 
				
			||||||
 | 
							say >&3 "checking unstable test: $2"
 | 
				
			||||||
 | 
							if test_run_ "$2" unstable; then
 | 
				
			||||||
 | 
								test_ok_ "$1"
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								test_known_broken_failure_ "$1"
 | 
				
			||||||
 | 
							fi
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
 | 
						echo >&3 ""
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Public: Run command and ensure that it fails in a controlled way.
 | 
					# Public: Run command and ensure that it fails in a controlled way.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Use it instead of "! <command>". For example, when <command> dies due to a
 | 
					# Use it instead of "! <command>". For example, when <command> dies due to a
 | 
				
			||||||
@@ -518,7 +655,7 @@ test_expect_code() {
 | 
				
			|||||||
	shift
 | 
						shift
 | 
				
			||||||
	"$@"
 | 
						"$@"
 | 
				
			||||||
	exit_code=$?
 | 
						exit_code=$?
 | 
				
			||||||
	if test $exit_code = $want_code; then
 | 
						if test "$exit_code" = "$want_code"; then
 | 
				
			||||||
		return 0
 | 
							return 0
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -528,7 +665,7 @@ test_expect_code() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# Public: Compare two files to see if expected output matches actual output.
 | 
					# Public: Compare two files to see if expected output matches actual output.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# The TEST_CMP variable defines the command used for the comparision; it
 | 
					# The TEST_CMP variable defines the command used for the comparison; it
 | 
				
			||||||
# defaults to "diff -u". Only when the test script was started with --verbose,
 | 
					# defaults to "diff -u". Only when the test script was started with --verbose,
 | 
				
			||||||
# will the command's output, the diff, be printed to the standard output.
 | 
					# will the command's output, the diff, be printed to the standard output.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
@@ -551,6 +688,79 @@ test_cmp() {
 | 
				
			|||||||
	${TEST_CMP:-diff -u} "$@"
 | 
						${TEST_CMP:-diff -u} "$@"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Public: portably print a sequence of numbers.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# seq is not in POSIX and GNU seq might not be available everywhere,
 | 
				
			||||||
 | 
					# so it is nice to have a seq implementation, even a very simple one.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# $1 - Starting number.
 | 
				
			||||||
 | 
					# $2 - Ending number.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Examples
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#   test_expect_success 'foo works 10 times' '
 | 
				
			||||||
 | 
					#       for i in $(test_seq 1 10)
 | 
				
			||||||
 | 
					#       do
 | 
				
			||||||
 | 
					#           foo || return
 | 
				
			||||||
 | 
					#       done
 | 
				
			||||||
 | 
					#   '
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Returns 0 if all the specified numbers can be displayed.
 | 
				
			||||||
 | 
					test_seq() {
 | 
				
			||||||
 | 
						i="$1"
 | 
				
			||||||
 | 
						j="$2"
 | 
				
			||||||
 | 
						while test "$i" -le "$j"
 | 
				
			||||||
 | 
						do
 | 
				
			||||||
 | 
							echo "$i" || return
 | 
				
			||||||
 | 
							i=$(("$i" + 1))
 | 
				
			||||||
 | 
						done
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Public: Check if the file expected to be empty is indeed empty, and barfs
 | 
				
			||||||
 | 
					# otherwise.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# $1 - File to check for emptiness.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Returns 0 if file is empty, 1 otherwise.
 | 
				
			||||||
 | 
					test_must_be_empty() {
 | 
				
			||||||
 | 
						if test -s "$1"
 | 
				
			||||||
 | 
						then
 | 
				
			||||||
 | 
							echo "'$1' is not empty, it contains:"
 | 
				
			||||||
 | 
							cat "$1"
 | 
				
			||||||
 | 
							return 1
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# debugging-friendly alternatives to "test [-f|-d|-e]"
 | 
				
			||||||
 | 
					# The commands test the existence or non-existence of $1. $2 can be
 | 
				
			||||||
 | 
					# given to provide a more precise diagnosis.
 | 
				
			||||||
 | 
					test_path_is_file () {
 | 
				
			||||||
 | 
						if ! test -f "$1"
 | 
				
			||||||
 | 
						then
 | 
				
			||||||
 | 
							echo "File $1 doesn't exist. $2"
 | 
				
			||||||
 | 
							false
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test_path_is_dir () {
 | 
				
			||||||
 | 
						if ! test -d "$1"
 | 
				
			||||||
 | 
						then
 | 
				
			||||||
 | 
							echo "Directory $1 doesn't exist. $2"
 | 
				
			||||||
 | 
							false
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Check if the directory exists and is empty as expected, barf otherwise.
 | 
				
			||||||
 | 
					test_dir_is_empty () {
 | 
				
			||||||
 | 
						test_path_is_dir "$1" &&
 | 
				
			||||||
 | 
						if test -n "$(find "$1" -mindepth 1 -maxdepth 1)"
 | 
				
			||||||
 | 
						then
 | 
				
			||||||
 | 
							echo "Directory '$1' is not empty, it contains:"
 | 
				
			||||||
 | 
							ls -la "$1"
 | 
				
			||||||
 | 
							return 1
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Public: Schedule cleanup commands to be run unconditionally at the end of a
 | 
					# Public: Schedule cleanup commands to be run unconditionally at the end of a
 | 
				
			||||||
# test.
 | 
					# test.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
@@ -576,6 +786,23 @@ test_when_finished() {
 | 
				
			|||||||
		} && (exit \"\$eval_ret\"); eval_ret=\$?; $test_cleanup"
 | 
							} && (exit \"\$eval_ret\"); eval_ret=\$?; $test_cleanup"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Public: Schedule cleanup commands to be run unconditionally when all tests
 | 
				
			||||||
 | 
					# have run.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# This can be used to clean up things like test databases. It is not needed to
 | 
				
			||||||
 | 
					# clean up temporary files, as test_done already does that.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Examples:
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#   cleanup mysql -e "DROP DATABASE mytest"
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Returns the exit code of the last cleanup command executed.
 | 
				
			||||||
 | 
					final_cleanup=
 | 
				
			||||||
 | 
					cleanup() {
 | 
				
			||||||
 | 
						final_cleanup="{ $*
 | 
				
			||||||
 | 
							} && (exit \"\$eval_ret\"); eval_ret=\$?; $final_cleanup"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Public: Summarize test results and exit with an appropriate error code.
 | 
					# Public: Summarize test results and exit with an appropriate error code.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Must be called at the end of each test script.
 | 
					# Must be called at the end of each test script.
 | 
				
			||||||
@@ -600,9 +827,9 @@ test_done() {
 | 
				
			|||||||
	EXIT_OK=t
 | 
						EXIT_OK=t
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if test -z "$HARNESS_ACTIVE"; then
 | 
						if test -z "$HARNESS_ACTIVE"; then
 | 
				
			||||||
		test_results_dir="$SHARNESS_TEST_DIRECTORY/test-results"
 | 
							test_results_dir="$SHARNESS_TEST_OUTPUT_DIRECTORY/test-results"
 | 
				
			||||||
		mkdir -p "$test_results_dir"
 | 
							mkdir -p "$test_results_dir"
 | 
				
			||||||
		test_results_path="$test_results_dir/${SHARNESS_TEST_FILE%.$SHARNESS_TEST_EXTENSION}.$$.counts"
 | 
							test_results_path="$test_results_dir/$this_test.$$.counts"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		cat >>"$test_results_path" <<-EOF
 | 
							cat >>"$test_results_path" <<-EOF
 | 
				
			||||||
		total $test_count
 | 
							total $test_count
 | 
				
			||||||
@@ -621,7 +848,7 @@ test_done() {
 | 
				
			|||||||
		say_color warn "# still have $test_broken known breakage(s)"
 | 
							say_color warn "# still have $test_broken known breakage(s)"
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
	if test "$test_broken" != 0 || test "$test_fixed" != 0; then
 | 
						if test "$test_broken" != 0 || test "$test_fixed" != 0; then
 | 
				
			||||||
		test_remaining=$(( $test_count - $test_broken - $test_fixed ))
 | 
							test_remaining=$((test_count - test_broken - test_fixed))
 | 
				
			||||||
		msg="remaining $test_remaining test(s)"
 | 
							msg="remaining $test_remaining test(s)"
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		test_remaining=$test_count
 | 
							test_remaining=$test_count
 | 
				
			||||||
@@ -641,6 +868,8 @@ test_done() {
 | 
				
			|||||||
		fi
 | 
							fi
 | 
				
			||||||
		say "1..$test_count$skip_all"
 | 
							say "1..$test_count$skip_all"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							test_eval_ "$final_cleanup"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		test -d "$remove_trash" &&
 | 
							test -d "$remove_trash" &&
 | 
				
			||||||
		cd "$(dirname "$remove_trash")" &&
 | 
							cd "$(dirname "$remove_trash")" &&
 | 
				
			||||||
		rm -rf "$(basename "$remove_trash")"
 | 
							rm -rf "$(basename "$remove_trash")"
 | 
				
			||||||
@@ -656,14 +885,15 @@ test_done() {
 | 
				
			|||||||
	esac
 | 
						esac
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Public: Root directory containing tests. Tests can override this variable,
 | 
					# Public: Source directory of test code and sharness library.
 | 
				
			||||||
# e.g. for testing Sharness itself.
 | 
					# This directory may be different from the directory in which tests are
 | 
				
			||||||
: ${SHARNESS_TEST_DIRECTORY:=$(pwd)}
 | 
					# being run.
 | 
				
			||||||
export SHARNESS_TEST_DIRECTORY
 | 
					: "${SHARNESS_TEST_SRCDIR:=$(cd "$(dirname "$0")" && pwd)}"
 | 
				
			||||||
 | 
					export SHARNESS_TEST_SRCDIR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Public: Build directory that will be added to PATH. By default, it is set to
 | 
					# Public: Build directory that will be added to PATH. By default, it is set to
 | 
				
			||||||
# the parent directory of SHARNESS_TEST_DIRECTORY.
 | 
					# the parent directory of SHARNESS_TEST_DIRECTORY.
 | 
				
			||||||
: ${SHARNESS_BUILD_DIRECTORY:="$SHARNESS_TEST_DIRECTORY/.."}
 | 
					: "${SHARNESS_BUILD_DIRECTORY:="$SHARNESS_TEST_DIRECTORY/.."}"
 | 
				
			||||||
PATH="$SHARNESS_BUILD_DIRECTORY:$PATH"
 | 
					PATH="$SHARNESS_BUILD_DIRECTORY:$PATH"
 | 
				
			||||||
export PATH SHARNESS_BUILD_DIRECTORY
 | 
					export PATH SHARNESS_BUILD_DIRECTORY
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -672,19 +902,43 @@ SHARNESS_TEST_FILE="$0"
 | 
				
			|||||||
export SHARNESS_TEST_FILE
 | 
					export SHARNESS_TEST_FILE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Prepare test area.
 | 
					# Prepare test area.
 | 
				
			||||||
test_dir="trash directory.$(basename "$SHARNESS_TEST_FILE" ".$SHARNESS_TEST_EXTENSION")"
 | 
					SHARNESS_TRASH_DIRECTORY="trash directory.$(basename "$SHARNESS_TEST_FILE" ".$SHARNESS_TEST_EXTENSION")"
 | 
				
			||||||
test -n "$root" && test_dir="$root/$test_dir"
 | 
					test -n "$root" && SHARNESS_TRASH_DIRECTORY="$root/$SHARNESS_TRASH_DIRECTORY"
 | 
				
			||||||
case "$test_dir" in
 | 
					case "$SHARNESS_TRASH_DIRECTORY" in
 | 
				
			||||||
/*) SHARNESS_TRASH_DIRECTORY="$test_dir" ;;
 | 
					/*) ;; # absolute path is good
 | 
				
			||||||
 *) SHARNESS_TRASH_DIRECTORY="$SHARNESS_TEST_DIRECTORY/$test_dir" ;;
 | 
					 *) SHARNESS_TRASH_DIRECTORY="$SHARNESS_TEST_OUTPUT_DIRECTORY/$SHARNESS_TRASH_DIRECTORY" ;;
 | 
				
			||||||
esac
 | 
					esac
 | 
				
			||||||
test "$debug" = "t" || remove_trash="$SHARNESS_TRASH_DIRECTORY"
 | 
					test "$debug" = "t" || remove_trash="$SHARNESS_TRASH_DIRECTORY"
 | 
				
			||||||
rm -rf "$test_dir" || {
 | 
					rm -rf "$SHARNESS_TRASH_DIRECTORY" || {
 | 
				
			||||||
	EXIT_OK=t
 | 
						EXIT_OK=t
 | 
				
			||||||
	echo >&5 "FATAL: Cannot prepare test area"
 | 
						echo >&5 "FATAL: Cannot prepare test area"
 | 
				
			||||||
	exit 1
 | 
						exit 1
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#  Load any extensions in $srcdir/sharness.d/*.sh
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					if test -d "${SHARNESS_TEST_SRCDIR}/sharness.d"
 | 
				
			||||||
 | 
					then
 | 
				
			||||||
 | 
						for file in "${SHARNESS_TEST_SRCDIR}"/sharness.d/*.sh
 | 
				
			||||||
 | 
						do
 | 
				
			||||||
 | 
							# Ensure glob was not an empty match:
 | 
				
			||||||
 | 
							test -e "${file}" || break
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if test -n "$debug"
 | 
				
			||||||
 | 
							then
 | 
				
			||||||
 | 
								echo >&5 "sharness: loading extensions from ${file}"
 | 
				
			||||||
 | 
							fi
 | 
				
			||||||
 | 
							. "${file}"
 | 
				
			||||||
 | 
							if test $? != 0
 | 
				
			||||||
 | 
							then
 | 
				
			||||||
 | 
								echo >&5 "sharness: Error loading ${file}. Aborting."
 | 
				
			||||||
 | 
								exit 1
 | 
				
			||||||
 | 
							fi
 | 
				
			||||||
 | 
						done
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Public: Empty trash directory, the test area, provided for each test. The HOME
 | 
					# Public: Empty trash directory, the test area, provided for each test. The HOME
 | 
				
			||||||
# variable is set to that directory too.
 | 
					# variable is set to that directory too.
 | 
				
			||||||
export SHARNESS_TRASH_DIRECTORY
 | 
					export SHARNESS_TRASH_DIRECTORY
 | 
				
			||||||
@@ -692,10 +946,10 @@ export SHARNESS_TRASH_DIRECTORY
 | 
				
			|||||||
HOME="$SHARNESS_TRASH_DIRECTORY"
 | 
					HOME="$SHARNESS_TRASH_DIRECTORY"
 | 
				
			||||||
export HOME
 | 
					export HOME
 | 
				
			||||||
 | 
					
 | 
				
			||||||
mkdir -p "$test_dir" || exit 1
 | 
					mkdir -p "$SHARNESS_TRASH_DIRECTORY" || exit 1
 | 
				
			||||||
# Use -P to resolve symlinks in our working directory so that the cwd
 | 
					# Use -P to resolve symlinks in our working directory so that the cwd
 | 
				
			||||||
# in subprocesses like git equals our $PWD (for pathname comparisons).
 | 
					# in subprocesses like git equals our $PWD (for pathname comparisons).
 | 
				
			||||||
cd -P "$test_dir" || exit 1
 | 
					cd -P "$SHARNESS_TRASH_DIRECTORY" || exit 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
this_test=${SHARNESS_TEST_FILE##*/}
 | 
					this_test=${SHARNESS_TEST_FILE##*/}
 | 
				
			||||||
this_test=${this_test%.$SHARNESS_TEST_EXTENSION}
 | 
					this_test=${this_test%.$SHARNESS_TEST_EXTENSION}
 | 
				
			||||||
@@ -708,4 +962,10 @@ for skp in $SKIP_TESTS; do
 | 
				
			|||||||
	esac
 | 
						esac
 | 
				
			||||||
done
 | 
					done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test -n "$TEST_LONG" && test_set_prereq EXPENSIVE
 | 
				
			||||||
 | 
					test -n "$TEST_INTERACTIVE" && test_set_prereq INTERACTIVE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Make sure this script ends with code 0
 | 
				
			||||||
 | 
					:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# vi: set ts=4 sw=4 noet :
 | 
					# vi: set ts=4 sw=4 noet :
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,8 +1,62 @@
 | 
				
			|||||||
#!/bin/sh
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
. ./sharness.sh
 | 
					: "${SHARNESS_TEST_SRCDIR:=$(cd "$(dirname "${BASH_SOURCE-$0}")" && pwd)}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_set_prereq PYTHON
 | 
					if [ -z "$SHARNESS" ] ; then
 | 
				
			||||||
 | 
						for d in \
 | 
				
			||||||
 | 
							"$SHARNESS_TEST_SRCDIR" \
 | 
				
			||||||
 | 
							"$HOME/share/sharness" \
 | 
				
			||||||
 | 
							"/usr/local/share/sharness" \
 | 
				
			||||||
 | 
							"/usr/share/sharness"
 | 
				
			||||||
 | 
						do
 | 
				
			||||||
 | 
							f="$d/sharness.sh"
 | 
				
			||||||
 | 
							if [ -f "$f" ] ; then
 | 
				
			||||||
 | 
								SHARNESS="$f"
 | 
				
			||||||
 | 
							fi
 | 
				
			||||||
 | 
						done
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					if [ -z "$SHARNESS" ] || [ ! -f "$SHARNESS" ] ; then
 | 
				
			||||||
 | 
						echo "sharness.sh not found" >&2
 | 
				
			||||||
 | 
						exit 1
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Prevent sharness from adding the source directory to PATH
 | 
				
			||||||
 | 
					# since the scripts use unversioned python for their shebang
 | 
				
			||||||
 | 
					# but tests should run under the python with mercurial support
 | 
				
			||||||
 | 
					# so create an empty directory and strip it from PATH afterwards
 | 
				
			||||||
 | 
					SHARNESS_BUILD_DIRECTORY="$(mktemp -d)"
 | 
				
			||||||
 | 
					. "$SHARNESS"
 | 
				
			||||||
 | 
					export PATH="${PATH#*:}"
 | 
				
			||||||
 | 
					rmdir "$SHARNESS_BUILD_DIRECTORY"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ -z "$TEST_INSTALLED_SCRIPTS" ] ; then
 | 
				
			||||||
 | 
						if [ -n "$PYTHON" ] && "$PYTHON" -c 'import mercurial' 2> /dev/null ; then
 | 
				
			||||||
 | 
							: Use chosen Python version
 | 
				
			||||||
 | 
						elif python3 -c 'import mercurial' 2> /dev/null ; then
 | 
				
			||||||
 | 
							PYTHON=python3
 | 
				
			||||||
 | 
						elif python2 -c 'import mercurial' 2> /dev/null ; then
 | 
				
			||||||
 | 
							PYTHON=python2
 | 
				
			||||||
 | 
						elif python -c 'import mercurial' 2> /dev/null ; then
 | 
				
			||||||
 | 
							PYTHON=python
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
 | 
						if [ -n "$PYTHON" ] ; then
 | 
				
			||||||
 | 
							test_set_prereq PYTHON
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							# Change shebang on a copy of scripts to chosen Python version
 | 
				
			||||||
 | 
							TEST_BIN="$SHARNESS_TRASH_DIRECTORY/bin"
 | 
				
			||||||
 | 
							mkdir -p "$TEST_BIN"
 | 
				
			||||||
 | 
							for s in git-remote-hg git-hg-helper ; do
 | 
				
			||||||
 | 
								printf "%s\n" "#!/usr/bin/env $PYTHON" > "$TEST_BIN/$s"
 | 
				
			||||||
 | 
								tail -n +2 "$SHARNESS_TEST_DIRECTORY/../$s" >> "$TEST_BIN/$s"
 | 
				
			||||||
 | 
								chmod u+x "$TEST_BIN/$s"
 | 
				
			||||||
 | 
							done
 | 
				
			||||||
 | 
							export PATH="$TEST_BIN${PATH:+:$PATH}"
 | 
				
			||||||
 | 
							unset TEST_BIN
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
						# The build/install process ensures Python is available
 | 
				
			||||||
 | 
						test_set_prereq PYTHON
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
GIT_AUTHOR_EMAIL=author@example.com
 | 
					GIT_AUTHOR_EMAIL=author@example.com
 | 
				
			||||||
GIT_AUTHOR_NAME='A U Thor'
 | 
					GIT_AUTHOR_NAME='A U Thor'
 | 
				
			||||||
@@ -10,3 +64,15 @@ GIT_COMMITTER_EMAIL=committer@example.com
 | 
				
			|||||||
GIT_COMMITTER_NAME='C O Mitter'
 | 
					GIT_COMMITTER_NAME='C O Mitter'
 | 
				
			||||||
export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME
 | 
					export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME
 | 
				
			||||||
export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME
 | 
					export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# maintain backwards compatible default
 | 
				
			||||||
 | 
					# (as used in remote helper)
 | 
				
			||||||
 | 
					git config --global init.defaultBranch master
 | 
				
			||||||
 | 
					git config --global protocol.file.allow always
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					unset XDG_CONFIG_HOME
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [[ $(uname -s) = MSYS* ]]; then
 | 
				
			||||||
 | 
						test_set_prereq WIN
 | 
				
			||||||
 | 
						export TEST_CMP='diff --strip-trailing-cr -u'
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										1
									
								
								tools/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								tools/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
				
			|||||||
 | 
					results.txt
 | 
				
			||||||
							
								
								
									
										198
									
								
								tools/check-versions
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										198
									
								
								tools/check-versions
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,198 @@
 | 
				
			|||||||
 | 
					#!/usr/bin/env ruby
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Copyright (c) 2019-2023 Felipe Contreras
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# This script runs the tests for all versions of hg.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# You can run it without arguments, in which case it runs the tests for all
 | 
				
			||||||
 | 
					# versions in `versions.txt`.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Or you can specify a single version manually:
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#   ./check-versions 6.3
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					require 'fileutils'
 | 
				
			||||||
 | 
					require 'tmpdir'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					$tests = %w[main.t bidi.t hg-git.t]
 | 
				
			||||||
 | 
					$workdir = "#{Dir.home}/.cache/git-remote-hg"
 | 
				
			||||||
 | 
					$builddir = Dir.mktmpdir("git-remote-hg-build-")
 | 
				
			||||||
 | 
					$testoutdir = Dir.mktmpdir("git-remote-hg-tests-")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					at_exit {
 | 
				
			||||||
 | 
					  FileUtils.remove_entry($builddir)
 | 
				
			||||||
 | 
					  FileUtils.remove_entry($testoutdir)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					QUIET, LOW, HIGH = (1..3).to_a
 | 
				
			||||||
 | 
					$verbosity = LOW
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Util {{{1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def section(text)
 | 
				
			||||||
 | 
					  puts [nil, text, '=' * text.size]
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def title(text)
 | 
				
			||||||
 | 
					  puts [nil, text, '-' * text.size] unless $verbosity < HIGH
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def run_cmd(cmd, fatal: true)
 | 
				
			||||||
 | 
					  puts cmd.join(' ') unless $verbosity < HIGH
 | 
				
			||||||
 | 
					  result = system(*cmd)
 | 
				
			||||||
 | 
					  unless result or not fatal
 | 
				
			||||||
 | 
					    STDERR.puts "Failed to run command '%s'" % cmd.join(' ')
 | 
				
			||||||
 | 
					    exit -1
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					  result
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def check_version(a, b)
 | 
				
			||||||
 | 
					  return true if a == '@'
 | 
				
			||||||
 | 
					  a = a.split('.').map(&:to_i)
 | 
				
			||||||
 | 
					  b = b.split('.').map(&:to_i)
 | 
				
			||||||
 | 
					  (a <=> b) >= 0
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Hg {{{1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class Hg
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def initialize
 | 
				
			||||||
 | 
					    @url = 'https://www.mercurial-scm.org/repo/hg'
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def dir
 | 
				
			||||||
 | 
					    "#{$workdir}/hg"
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def clone
 | 
				
			||||||
 | 
					    run_cmd %w[hg clone -q] + [@url, dir]
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def checkout(version)
 | 
				
			||||||
 | 
					    Dir.chdir(dir) do
 | 
				
			||||||
 | 
					      run_cmd %w[hg update --clean -q] << version
 | 
				
			||||||
 | 
					      checkout_fix(version)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def build
 | 
				
			||||||
 | 
					    Dir.chdir(dir) do
 | 
				
			||||||
 | 
					      targets = %w[build_py build_ext].map { |e| [e, '--build-lib', "#{$builddir}/python"] }
 | 
				
			||||||
 | 
					      run_cmd %w[python setup.py --quiet] + targets.flatten
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def checkout_fix(version)
 | 
				
			||||||
 | 
					    FileUtils.cp('hg', "#{$builddir}/bin/")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return if check_version(version, '4.3')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if run_cmd %W[hg import -q --no-commit #{__dir__}/hg_setup_hack_2.4.patch], fatal: false
 | 
				
			||||||
 | 
					      File.write('.hg_force_version', "%s\n" % version)
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					      File.write('mercurial/__version__.py', "version = \"%s\"\n" % version)
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Functions {{{1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def setup
 | 
				
			||||||
 | 
					  dirs = %w[bin python]
 | 
				
			||||||
 | 
					  FileUtils.mkdir_p(dirs.map { |e| "#{$builddir}/#{e}" })
 | 
				
			||||||
 | 
					  FileUtils.mkdir_p($workdir)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return if File.exist?($hg.dir)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if $verbosity < HIGH
 | 
				
			||||||
 | 
					    puts "Cloning hg"
 | 
				
			||||||
 | 
					  else
 | 
				
			||||||
 | 
					    title "Cloning hg"
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					  $hg.clone
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def test_env(paths: nil)
 | 
				
			||||||
 | 
					  old = ENV.to_h
 | 
				
			||||||
 | 
					  paths.each do |id, path|
 | 
				
			||||||
 | 
					    name = id.to_s
 | 
				
			||||||
 | 
					    ENV[name] = "#{path}:#{ENV[name]}"
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					  r = yield
 | 
				
			||||||
 | 
					  ENV.replace(old)
 | 
				
			||||||
 | 
					  return r
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def run_tests(tests)
 | 
				
			||||||
 | 
					  title "Running tests"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Dir.chdir("#{__dir__}/../test") do
 | 
				
			||||||
 | 
					    case $verbosity
 | 
				
			||||||
 | 
					    when QUIET
 | 
				
			||||||
 | 
					      tests_opt = tests.join(' ')
 | 
				
			||||||
 | 
					      cmd = "prove -q #{tests_opt} :: -i"
 | 
				
			||||||
 | 
					    when LOW
 | 
				
			||||||
 | 
					      tests_opt = "T='%s'" % tests.join(' ')
 | 
				
			||||||
 | 
					      cmd = "make -j1 #{tests_opt}"
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					      tests_opt = "T='%s'" % tests.join(' ')
 | 
				
			||||||
 | 
					      cmd = "TEST_OPTS='-v -i' make -j1 #{tests_opt}"
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					    system(cmd)
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def check(version)
 | 
				
			||||||
 | 
					  section version
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  title "Checking out hg #{version}"
 | 
				
			||||||
 | 
					  $hg.checkout(version)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  title "Building hg"
 | 
				
			||||||
 | 
					  $hg.build
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  paths = {
 | 
				
			||||||
 | 
					    PATH: "#{$builddir}/bin",
 | 
				
			||||||
 | 
					    PYTHONPATH: "#{$builddir}/python",
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  test_env(paths: paths) do
 | 
				
			||||||
 | 
					    ENV['SHARNESS_TEST_OUTPUT_DIRECTORY'] = $testoutdir
 | 
				
			||||||
 | 
					    run_tests($tests)
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					$hg = Hg.new()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Main {{{1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					setup
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					$checks = []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					$version = ARGV.first
 | 
				
			||||||
 | 
					$checks = File.readlines(__dir__ + '/versions.txt', chomp: true)
 | 
				
			||||||
 | 
					$results = File.open(__dir__ + '/results.txt', 'w')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if $version
 | 
				
			||||||
 | 
					  $verbosity = HIGH
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  exit check($version) ? 0 : 1
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
					  $verbosity = QUIET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  failures = 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  $checks.each do |version|
 | 
				
			||||||
 | 
					    result = check(version)
 | 
				
			||||||
 | 
					    failures += 1 unless result
 | 
				
			||||||
 | 
					    $results.puts '%s # %s' % [version, result ? 'OK' : 'FAIL']
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  exit 1 unless failures == 0
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
							
								
								
									
										15
									
								
								tools/hg_setup_hack_2.4.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								tools/hg_setup_hack_2.4.patch
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
				
			|||||||
 | 
					diff --git a/setup.py b/setup.py
 | 
				
			||||||
 | 
					--- a/setup.py
 | 
				
			||||||
 | 
					+++ b/setup.py
 | 
				
			||||||
 | 
					@@ -181,7 +181,10 @@
 | 
				
			||||||
 | 
					     # error 0xc0150004. See: http://bugs.python.org/issue3440
 | 
				
			||||||
 | 
					     env['SystemRoot'] = os.environ['SystemRoot']
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					-if os.path.isdir('.hg'):
 | 
				
			||||||
 | 
					+if os.path.exists('.hg_force_version'):
 | 
				
			||||||
 | 
					+    with open('.hg_force_version') as f:
 | 
				
			||||||
 | 
					+        version = f.read().rstrip('\n')
 | 
				
			||||||
 | 
					+elif os.path.isdir('.hg'):
 | 
				
			||||||
 | 
					     cmd = [sys.executable, 'hg', 'log', '-r', '.', '--template', '{tags}\n']
 | 
				
			||||||
 | 
					     numerictags = [t for t in runhg(cmd, env).split() if t[0].isdigit()]
 | 
				
			||||||
 | 
					     hgid = runhg([sys.executable, 'hg', 'id', '-i'], env).strip()
 | 
				
			||||||
							
								
								
									
										46
									
								
								tools/versions.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								tools/versions.txt
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,46 @@
 | 
				
			|||||||
 | 
					2.4
 | 
				
			||||||
 | 
					2.5
 | 
				
			||||||
 | 
					2.6
 | 
				
			||||||
 | 
					2.7
 | 
				
			||||||
 | 
					2.8
 | 
				
			||||||
 | 
					2.9
 | 
				
			||||||
 | 
					3.0
 | 
				
			||||||
 | 
					3.1
 | 
				
			||||||
 | 
					3.2
 | 
				
			||||||
 | 
					3.3
 | 
				
			||||||
 | 
					3.4
 | 
				
			||||||
 | 
					3.5
 | 
				
			||||||
 | 
					3.6
 | 
				
			||||||
 | 
					3.7
 | 
				
			||||||
 | 
					3.8
 | 
				
			||||||
 | 
					3.9
 | 
				
			||||||
 | 
					4.0
 | 
				
			||||||
 | 
					4.1
 | 
				
			||||||
 | 
					4.2
 | 
				
			||||||
 | 
					4.3
 | 
				
			||||||
 | 
					4.4
 | 
				
			||||||
 | 
					4.5
 | 
				
			||||||
 | 
					4.6
 | 
				
			||||||
 | 
					4.7
 | 
				
			||||||
 | 
					4.8
 | 
				
			||||||
 | 
					4.9
 | 
				
			||||||
 | 
					5.0
 | 
				
			||||||
 | 
					5.1
 | 
				
			||||||
 | 
					5.2
 | 
				
			||||||
 | 
					5.3
 | 
				
			||||||
 | 
					5.4
 | 
				
			||||||
 | 
					5.5
 | 
				
			||||||
 | 
					5.6
 | 
				
			||||||
 | 
					5.7
 | 
				
			||||||
 | 
					5.8
 | 
				
			||||||
 | 
					5.9
 | 
				
			||||||
 | 
					6.0
 | 
				
			||||||
 | 
					6.1
 | 
				
			||||||
 | 
					6.2
 | 
				
			||||||
 | 
					6.3
 | 
				
			||||||
 | 
					6.4
 | 
				
			||||||
 | 
					6.5
 | 
				
			||||||
 | 
					6.6
 | 
				
			||||||
 | 
					6.7
 | 
				
			||||||
 | 
					6.8
 | 
				
			||||||
 | 
					6.9
 | 
				
			||||||
		Reference in New Issue
	
	Block a user