##// END OF EJS Templates
transaction: issue "new obsmarkers" message at the end of the transaction...
transaction: issue "new obsmarkers" message at the end of the transaction Instead of making bundle2 code responsible for this, it seems better to have it handled and the transaction level. First, it means the message will be more consistently printed. Second it means we won't spam the message over and over if the data arrive in multiple piece. Third, we are planning to move other similar message at the same level (for the same reason) so having them all at the same location will help us to control the order they are displayed.

File last commit:

r41885:c70bdd22 default
r43164:38392d5b default
Show More
test-import-context.t
129 lines | 2.4 KiB | text/troff | Tads3Lexer
/ tests / test-import-context.t
Patrick Mezard
Test applying context diffs
r12825 Test applying context diffs
$ cat > writepatterns.py <<EOF
> import sys
>
> path = sys.argv[1]
> lasteol = sys.argv[2] == '1'
> patterns = sys.argv[3:]
>
Pulkit Goyal
py3: replace file() with open()...
r36412 > fp = open(path, 'wb')
Patrick Mezard
Test applying context diffs
r12825 > for i, pattern in enumerate(patterns):
> count = int(pattern[0:-1])
Pulkit Goyal
py3: encode sys.argv to bytes using .encode()...
r38384 > char = pattern[-1].encode('utf8') + b'\n'
Patrick Mezard
Test applying context diffs
r12825 > if not lasteol and i == len(patterns) - 1:
FUJIWARA Katsunori
tests: bulk changes to avoid whitespace errors of check-code.py...
r41885 > fp.write((char * count)[:-1])
Patrick Mezard
Test applying context diffs
r12825 > else:
FUJIWARA Katsunori
tests: bulk changes to avoid whitespace errors of check-code.py...
r41885 > fp.write(char * count)
Patrick Mezard
Test applying context diffs
r12825 > fp.close()
> EOF
$ cat > cat.py <<EOF
> import sys
Matt Harbison
py3: fix test-import-context.t
r40386 > from mercurial import pycompat
> from mercurial.utils import stringutil
> pycompat.stdout.write(b'%s\n'
> % stringutil.pprint(open(sys.argv[1], 'rb').read()))
Patrick Mezard
Test applying context diffs
r12825 > EOF
Initialize the test repository
$ hg init repo
$ cd repo
Matt Harbison
tests: quote PYTHON usage...
r39743 $ "$PYTHON" ../writepatterns.py a 0 5A 1B 5C 1D
$ "$PYTHON" ../writepatterns.py b 1 1A 1B
$ "$PYTHON" ../writepatterns.py c 1 5A
$ "$PYTHON" ../writepatterns.py d 1 5A 1B
Patrick Mezard
Test applying context diffs
r12825 $ hg add
adding a
adding b
adding c
adding d
$ hg ci -m addfiles
Add file, missing a last end of line
$ hg import --no-commit - <<EOF
> *** /dev/null 2010-10-16 18:05:49.000000000 +0200
> --- b/newnoeol 2010-10-16 18:23:26.000000000 +0200
> ***************
> *** 0 ****
> --- 1,2 ----
> + a
> + b
> \ No newline at end of file
> *** a/a Sat Oct 16 16:35:51 2010
> --- b/a Sat Oct 16 16:35:51 2010
> ***************
> *** 3,12 ****
> A
> A
> A
> ! B
> C
> C
> C
> C
> C
> ! D
> \ No newline at end of file
> --- 3,13 ----
> A
> A
> A
> ! E
> C
> C
> C
> C
> C
> ! F
> ! F
>
> *** a/b 2010-10-16 18:40:38.000000000 +0200
> --- /dev/null 2010-10-16 18:05:49.000000000 +0200
> ***************
> *** 1,2 ****
> - A
> - B
> --- 0 ----
> *** a/c Sat Oct 16 21:34:26 2010
> --- b/c Sat Oct 16 21:34:27 2010
> ***************
> *** 3,5 ****
> --- 3,7 ----
> A
> A
> A
> + B
> + B
> *** a/d Sat Oct 16 21:47:20 2010
> --- b/d Sat Oct 16 21:47:22 2010
> ***************
> *** 2,6 ****
> A
> A
> A
> - A
> - B
> --- 2,4 ----
> EOF
applying patch from stdin
$ hg st
M a
M c
M d
A newnoeol
R b
What's in a
Matt Harbison
tests: quote PYTHON usage...
r39743 $ "$PYTHON" ../cat.py a
Patrick Mezard
Test applying context diffs
r12825 'A\nA\nA\nA\nA\nE\nC\nC\nC\nC\nC\nF\nF\n'
Matt Harbison
tests: quote PYTHON usage...
r39743 $ "$PYTHON" ../cat.py newnoeol
Patrick Mezard
Test applying context diffs
r12825 'a\nb'
Matt Harbison
tests: quote PYTHON usage...
r39743 $ "$PYTHON" ../cat.py c
Patrick Mezard
Test applying context diffs
r12825 'A\nA\nA\nA\nA\nB\nB\n'
Matt Harbison
tests: quote PYTHON usage...
r39743 $ "$PYTHON" ../cat.py d
Patrick Mezard
Test applying context diffs
r12825 'A\nA\nA\nA\n'
Mads Kiilerich
tests: add missing trailing 'cd ..'...
r16913 $ cd ..