tests/test-conflict.t
author Patrick Mezard <pmezard@gmail.com>
Mon, 01 Aug 2011 23:58:50 +0200
branchstable
changeset 15005 4a43e23b8c55
parent 12316 4134686b83e1
child 15501 2371f4aea665
permissions -rw-r--r--
hgweb: do not ignore [auth] if url has a username (issue2822) The [auth] section was ignored when handling URLs like: http://user@example.com/foo Instead, we look in [auth] for an entry matching the URL and supplied user name. Entries without username can match URL with a username. Prefix length ties are resolved in favor of entries matching the username. With: foo.prefix = http://example.org foo.username = user foo.password = password bar.prefix = http://example.org/bar and the input URL: http://user@example.org/bar the 'bar' entry will be selected because of prefix length, therefore prompting for a password. This behaviour ensure that entries selection is consistent when looking for credentials or for certificates, and that certificates can be picked even if their entries do no define usernames while the URL does. Additionally, entries without a username matched against a username are returned as if they did have requested username set to avoid prompting again for a username if the password is not set. v2: reparse the URL in readauthforuri() to handle HTTP and HTTPS similarly. v3: allow unset usernames to match URL usernames to pick certificates. Resolve prefix length ties in favor of entries with usernames.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11797
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
     1
  $ hg init
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
     2
  $ echo "nothing" > a
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
     3
  $ hg add a
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11797
diff changeset
     4
  $ hg commit -m ancestor
11797
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
     5
  $ echo "something" > a
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11797
diff changeset
     6
  $ hg commit -m branch1
11797
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
     7
  $ hg co 0
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
     8
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
     9
  $ echo "something else" > a
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11797
diff changeset
    10
  $ hg commit -m branch2
11797
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    11
  created new head
346
f69a5d2d4fe1 merge3: fix argument order
mpm@selenic.com
parents:
diff changeset
    12
11797
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    13
  $ hg merge 1
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    14
  merging a
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    15
  warning: conflicts during merge.
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    16
  merging a failed!
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    17
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
12314
f2daa6ab514a merge: suggest 'hg up -C .' for discarding changes, not 'hg up -C'
Brodie Rao <brodie@bitheap.org>
parents: 12156
diff changeset
    18
  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12314
diff changeset
    19
  [1]
11797
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    20
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    21
  $ hg id
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 11797
diff changeset
    22
  32e80765d7fe+75234512624c+ tip
11797
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    23
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    24
  $ cat a
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    25
  <<<<<<< local
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    26
  something else
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    27
  =======
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    28
  something
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    29
  >>>>>>> other
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    30
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    31
  $ hg status
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    32
  M a
66e4e8e8b1e5 tests: unify test-conflict
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 4387
diff changeset
    33
  ? a.orig