##// END OF EJS Templates
merge with stable
Matt Harbison -
r49975:ea98850a merge default
parent child Browse files
Show More
@@ -2934,7 +2934,7 b' def amend(ui, repo, old, extra, pats, op'
2934 def filectxfn(repo, ctx_, path):
2934 def filectxfn(repo, ctx_, path):
2935 try:
2935 try:
2936 # Return None for removed files.
2936 # Return None for removed files.
2937 if path in wctx.removed():
2937 if path in wctx.removed() and path in filestoamend:
2938 return None
2938 return None
2939
2939
2940 # If the file being considered is not amongst the files
2940 # If the file being considered is not amongst the files
@@ -2317,7 +2317,7 b' coreconfigitem('
2317 coreconfigitem(
2317 coreconfigitem(
2318 b'ui',
2318 b'ui',
2319 b'large-file-limit',
2319 b'large-file-limit',
2320 default=10000000,
2320 default=10 * (2 ** 20),
2321 )
2321 )
2322 coreconfigitem(
2322 coreconfigitem(
2323 b'ui',
2323 b'ui',
@@ -2148,9 +2148,9 b' def debuglocks(ui, repo, **opts):'
2148 """
2148 """
2149
2149
2150 if opts.get('force_free_lock'):
2150 if opts.get('force_free_lock'):
2151 repo.svfs.unlink(b'lock')
2151 repo.svfs.tryunlink(b'lock')
2152 if opts.get('force_free_wlock'):
2152 if opts.get('force_free_wlock'):
2153 repo.vfs.unlink(b'wlock')
2153 repo.vfs.tryunlink(b'wlock')
2154 if opts.get('force_free_lock') or opts.get('force_free_wlock'):
2154 if opts.get('force_free_lock') or opts.get('force_free_wlock'):
2155 return 0
2155 return 0
2156
2156
@@ -2630,7 +2630,8 b' User interface controls.'
2630 ``large-file-limit``
2630 ``large-file-limit``
2631 Largest file size that gives no memory use warning.
2631 Largest file size that gives no memory use warning.
2632 Possible values are integers or 0 to disable the check.
2632 Possible values are integers or 0 to disable the check.
2633 (default: 10000000)
2633 Value is expressed in bytes by default, one can use standard units for
2634 convenience (e.g. 10MB, 0.1GB, etc) (default: 10MB)
2634
2635
2635 ``logtemplate``
2636 ``logtemplate``
2636 (DEPRECATED) Use ``command-templates.log`` instead.
2637 (DEPRECATED) Use ``command-templates.log`` instead.
@@ -214,9 +214,9 b' def update_hash_refs(repo, commitmsg, pe'
214 for h in hashes:
214 for h in hashes:
215 try:
215 try:
216 fullnode = scmutil.resolvehexnodeidprefix(unfi, h)
216 fullnode = scmutil.resolvehexnodeidprefix(unfi, h)
217 except error.WdirUnsupported:
217 except (error.WdirUnsupported, error.AmbiguousPrefixLookupError):
218 # Someone has an fffff... in a commit message we're
218 # Someone has an fffff... or some other prefix that's ambiguous in a
219 # rewriting. Don't try rewriting that.
219 # commit message we're rewriting. Don't try rewriting that.
220 continue
220 continue
221 if fullnode is None:
221 if fullnode is None:
222 continue
222 continue
@@ -111,7 +111,9 b' class WriteAllWrapper:'
111 total_to_write = len(s)
111 total_to_write = len(s)
112 total_written = 0
112 total_written = 0
113 while total_written < total_to_write:
113 while total_written < total_to_write:
114 total_written += write1(m[total_written:])
114 c = write1(m[total_written:])
115 if c:
116 total_written += c
115 return total_written
117 return total_written
116
118
117
119
@@ -1402,6 +1402,9 b' class Test(unittest.TestCase):'
1402 env['PYTHONUSERBASE'] = sysconfig.get_config_var('userbase') or ''
1402 env['PYTHONUSERBASE'] = sysconfig.get_config_var('userbase') or ''
1403 env['HGEMITWARNINGS'] = '1'
1403 env['HGEMITWARNINGS'] = '1'
1404 env['TESTTMP'] = _bytes2sys(self._testtmp)
1404 env['TESTTMP'] = _bytes2sys(self._testtmp)
1405 # the FORWARD_SLASH version is useful when running `sh` on non unix
1406 # system (e.g. Windows)
1407 env['TESTTMP_FORWARD_SLASH'] = env['TESTTMP'].replace(os.sep, '/')
1405 uid_file = os.path.join(_bytes2sys(self._testtmp), 'UID')
1408 uid_file = os.path.join(_bytes2sys(self._testtmp), 'UID')
1406 env['HGTEST_UUIDFILE'] = uid_file
1409 env['HGTEST_UUIDFILE'] = uid_file
1407 env['TESTNAME'] = self.name
1410 env['TESTNAME'] = self.name
@@ -3065,6 +3068,10 b' class TestRunner:'
3065 if pathname:
3068 if pathname:
3066 testdir = os.path.join(testdir, pathname)
3069 testdir = os.path.join(testdir, pathname)
3067 self._testdir = osenvironb[b'TESTDIR'] = testdir
3070 self._testdir = osenvironb[b'TESTDIR'] = testdir
3071 osenvironb[b'TESTDIR_FORWARD_SLASH'] = osenvironb[b'TESTDIR'].replace(
3072 os.sep.encode('ascii'), b'/'
3073 )
3074
3068 if self.options.outputdir:
3075 if self.options.outputdir:
3069 self._outputdir = canonpath(_sys2bytes(self.options.outputdir))
3076 self._outputdir = canonpath(_sys2bytes(self.options.outputdir))
3070 else:
3077 else:
@@ -3209,6 +3216,9 b' class TestRunner:'
3209 fileb = _sys2bytes(__file__)
3216 fileb = _sys2bytes(__file__)
3210 runtestdir = os.path.abspath(os.path.dirname(fileb))
3217 runtestdir = os.path.abspath(os.path.dirname(fileb))
3211 osenvironb[b'RUNTESTDIR'] = runtestdir
3218 osenvironb[b'RUNTESTDIR'] = runtestdir
3219 osenvironb[b'RUNTESTDIR_FORWARD_SLASH'] = runtestdir.replace(
3220 os.sep.encode('ascii'), b'/'
3221 )
3212 sepb = _sys2bytes(os.pathsep)
3222 sepb = _sys2bytes(os.pathsep)
3213 path = [self._bindir, runtestdir] + osenvironb[b"PATH"].split(sepb)
3223 path = [self._bindir, runtestdir] + osenvironb[b"PATH"].split(sepb)
3214 if os.path.islink(__file__):
3224 if os.path.islink(__file__):
@@ -325,6 +325,15 b' Existing copy information is preserved b'
325 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-*-amend.hg (glob)
325 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-*-amend.hg (glob)
326 $ hg showcopies
326 $ hg showcopies
327 a -> l
327 a -> l
328
329 No crash on partial amend
330 $ hg st --change .
331 A l
332 $ echo modified >> a
333 $ hg rm l
334 $ hg commit --amend a
335 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-*-amend.hg (glob)
336
328 $ cd ..
337 $ cd ..
329
338
330 Test rebasing a commit with copy information
339 Test rebasing a commit with copy information
@@ -9,12 +9,12 b" while we're running"
9 $ hg init a
9 $ hg init a
10 $ cd a
10 $ cd a
11
11
12 $ cat > "$TESTTMP/waitlock_editor.sh" <<EOF
12 $ cat > "$TESTTMP_FORWARD_SLASH/waitlock_editor.sh" <<EOF
13 > [ -n "\${WAITLOCK_ANNOUNCE:-}" ] && touch "\${WAITLOCK_ANNOUNCE}"
13 > [ -n "\${WAITLOCK_ANNOUNCE:-}" ] && touch "\${WAITLOCK_ANNOUNCE}"
14 > f="\${WAITLOCK_FILE}"
14 > f="\${WAITLOCK_FILE}"
15 > start=\`date +%s\`
15 > start=\`date +%s\`
16 > timeout=5
16 > timeout=5
17 > $RUNTESTDIR/testlib/wait-on-file "\$timeout" "\$f"
17 > "$RUNTESTDIR_FORWARD_SLASH/testlib/wait-on-file" "\$timeout" "\$f"
18 > if [ \$# -gt 1 ]; then
18 > if [ \$# -gt 1 ]; then
19 > cat "\$@"
19 > cat "\$@"
20 > fi
20 > fi
@@ -27,9 +27,9 b" this all starts, so let's make one."
27 $ hg commit -qAm 'r0'
27 $ hg commit -qAm 'r0'
28
28
29 Start an hg commit that will take a while
29 Start an hg commit that will take a while
30 $ EDITOR_STARTED="$(pwd)/.editor_started"
30 $ EDITOR_STARTED="$TESTTMP_FORWARD_SLASH/a/.editor_started"
31 $ MISCHIEF_MANAGED="$(pwd)/.mischief_managed"
31 $ MISCHIEF_MANAGED="$TESTTMP_FORWARD_SLASH/a/.mischief_managed"
32 $ JOBS_FINISHED="$(pwd)/.jobs_finished"
32 $ JOBS_FINISHED="$TESTTMP_FORWARD_SLASH/a/.jobs_finished"
33
33
34 #if fail-if-detected
34 #if fail-if-detected
35 $ cat >> .hg/hgrc << EOF
35 $ cat >> .hg/hgrc << EOF
@@ -38,14 +38,24 b' Start an hg commit that will take a whil'
38 > EOF
38 > EOF
39 #endif
39 #endif
40
40
41 $ cat >> .hg/hgrc << EOF
42 > [ui]
43 > editor=sh $TESTTMP_FORWARD_SLASH/waitlock_editor.sh
44 > EOF
45
41 $ echo foo > foo
46 $ echo foo > foo
42 $ (WAITLOCK_ANNOUNCE="${EDITOR_STARTED}" \
47 $ (unset HGEDITOR;
48 > WAITLOCK_ANNOUNCE="${EDITOR_STARTED}" \
43 > WAITLOCK_FILE="${MISCHIEF_MANAGED}" \
49 > WAITLOCK_FILE="${MISCHIEF_MANAGED}" \
44 > HGEDITOR="sh $TESTTMP/waitlock_editor.sh" \
45 > hg commit -qAm 'r1 (foo)' --edit foo > .foo_commit_out 2>&1 ; touch "${JOBS_FINISHED}") &
50 > hg commit -qAm 'r1 (foo)' --edit foo > .foo_commit_out 2>&1 ; touch "${JOBS_FINISHED}") &
46
51
47 Wait for the "editor" to actually start
52 Wait for the "editor" to actually start
48 $ WAITLOCK_FILE="${EDITOR_STARTED}" sh "$TESTTMP/waitlock_editor.sh"
53 $ sh "$RUNTESTDIR_FORWARD_SLASH/testlib/wait-on-file" 5 "${EDITOR_STARTED}"
54
55 $ cat >> .hg/hgrc << EOF
56 > [ui]
57 > editor=
58 > EOF
49
59
50 Break the locks, and make another commit.
60 Break the locks, and make another commit.
51 $ hg debuglocks -LW
61 $ hg debuglocks -LW
@@ -59,7 +69,7 b' Break the locks, and make another commit'
59 Awaken the editor from that first commit
69 Awaken the editor from that first commit
60 $ touch "${MISCHIEF_MANAGED}"
70 $ touch "${MISCHIEF_MANAGED}"
61 And wait for it to finish
71 And wait for it to finish
62 $ WAITLOCK_FILE="${JOBS_FINISHED}" sh "$TESTTMP/waitlock_editor.sh"
72 $ WAITLOCK_FILE="${JOBS_FINISHED}" sh "$TESTTMP_FORWARD_SLASH/waitlock_editor.sh"
63
73
64 #if skip-detection
74 #if skip-detection
65 (Ensure there was no output)
75 (Ensure there was no output)
@@ -1003,6 +1003,32 b' Test that update_hash_refs works.'
1003 o 0: d20a80d4def3 'base'
1003 o 0: d20a80d4def3 'base'
1004
1004
1005
1005
1006 Add an explicit test for rewrite_hash_refs when the detected prefix is
1007 ambiguous. Here's the super low-tech way I found this collision, if the hashing
1008 scheme ever changes:
1009 # hg init
1010 # echo test0 > test
1011 # hg ci -qAm 'test0' -u 'test' -d '0 0'
1012 # i=1
1013 # while [[ $(chg log -r . -T'{shortest(node, 6)}' | wc -c) -eq 6 ]]; do
1014 # chg co -r 0000000000
1015 # echo "test$i" > test
1016 # chg ci -qAm "test$i" -u test -d '0 0'
1017 # (( ++i ))
1018 # done
1019 $ hg co -q 0000000000
1020 $ echo test5281 > test
1021 $ hg ci -qAm 'test5281'
1022 $ hg co -q 000000000
1023 $ echo test9912 > test
1024 $ hg ci -qAm 'test9912'
1025 $ hg co -q 4
1026 $ echo contents > some_file
1027 $ hg ci -qAm 'The previous two (parentless) commits had a hash prefix of b04363. Check that rewrite_hash_refs will not fail because of that.'
1028 $ hg rebase -r . -d 5
1029 rebasing 8:5c4cdabf5769 tip "The previous two (parentless) commits had a hash prefix of b04363. Check that rewrite_hash_refs will not fail because of that."
1030 saved backup bundle to $TESTTMP/keep_merge/.hg/strip-backup/5c4cdabf5769-335e1828-rebase.hg
1031
1006 $ cd ..
1032 $ cd ..
1007
1033
1008 Test (virtual) working directory without changes, created by merge conflict
1034 Test (virtual) working directory without changes, created by merge conflict
General Comments 0
You need to be logged in to leave comments. Login now