Commit Graph

8 Commits

Author SHA1 Message Date
Matt Harbison
7d8bebd9c1 tests: remove (glob) annotations that were only for '\' matches
# skip-blame because this was mechanically rewritten the following script.  I
ran it on both *.t and *.py, but none of the *.py changes were proper.  All *.t
ones appear to be, and they run without addition failures on both Windows and
Linux.

  import argparse
  import os
  import re

  ap = argparse.ArgumentParser()
  ap.add_argument('path', nargs='+')
  opts = ap.parse_args()

  globre = re.compile(r'^(.*) \(glob\)(.*)$')

  for p in opts.path:
      tmp = p + '.tmp'
      with open(p, 'rb') as src, open(tmp, 'wb') as dst:
          for line in src:
              m = globre.match(line)
              if not m or '$LOCALIP' in line or '*' in line:
                  dst.write(line)
                  continue
              if '?' in line[:-3] or ('?' in line[:-3] and line[-3:] != '(?)'):
                  dst.write(line)
                  continue
              dst.write(m.group(1) + m.group(2) + '\n')
      os.unlink(p)
      os.rename(tmp, p)
2017-12-10 22:50:57 -05:00
Denis Laxalde
9efc7f05e3 transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Upon pull or unbundle, we display a message with the range of new revisions
fetched. This revision range could readily be used after a pull to look out
what's new with 'hg log'. The algorithm takes care of filtering "obsolete"
revisions that might be present in transaction's "changes" but should not be
displayed to the end user.
2017-10-12 09:39:50 +02:00
Yuya Nishihara
509744ddfc ssh: unban the use of pipe character in user@host:port string
This vulnerability was fixed by the previous patch and there were more ways
to exploit than using '|shellcmd'. So it doesn't make sense to reject only
pipe character.

Test cases are updated to actually try to exploit the bug. As the SSH bridge
of git/svn subrepos are not managed by our code, the tests for non-hg subrepos
are just removed.

This may be folded into the original patches.
2017-08-07 22:22:28 +09:00
Sean Farley
ea5a6b2798 push: add tests for unsafe ssh url (SEC) 2017-07-31 14:40:28 -07:00
Pierre-Yves David
240af74d9c pushrace: avoid crash on bare push when using concurrent push mode
If the remote is empty, we do now bother computing head changes and the
'pushbranchmap' attribute stays at None.

We now handle and tests this case.
2017-06-28 17:41:25 +02:00
Pierre-Yves David
938c5644af tests: merge 'test-push-hook-lock.t' into 'test-push.t'
That test file is very small and is merge with the new 'test-push.t'. No logic
is changed.

We don't register this as a copy because is actually a "ypoc" merging two file
together without replacing the destination and Mercurial cannot express that.
2016-11-03 05:12:23 +01:00
Pierre-Yves David
8eb3ae733d tests: merge 'test-push-validation.t' into 'test-push.t'
That test file is very small and is merge with the new 'test-push.t'. No logic
is changed but repository name are update to avoid collision.

We don't register this as a copy because is actually a "ypoc" merging two file
together without replacing the destination and Mercurial cannot express that.
2016-11-03 05:10:14 +01:00
Pierre-Yves David
7cb95b138e test: rename 'test-push-r.t' to 'test-push.t'
We do not have a simple test for 'hg push' but we have multiple tiny tests for
various aspect of it. We'll unify them into a single file, and we start with
'test-push-r.t'. The code is unchanged but we renamed the repository used to
avoid collision with other tests we'll import in coming changesets.

Test timing for the record:

start   end     cuser   csys    real      Test
  1.850   2.640   0.650   0.090   0.790   test-push-validation.t
  2.640   3.520   0.760   0.090   0.880   test-push-hook-lock.t
  0.000   1.850   1.560   0.210   1.850   test-push-r.t
2016-11-03 04:58:46 +01:00