tests/test-subrepo-missing.t
author Angel Ezquerra <angel.ezquerra@gmail.com>
Sun, 01 Apr 2012 14:12:14 +0200
changeset 16402 1fb2f1400ea8
parent 16073 b254f827b7a6
child 16595 2de6ac4ac17c
permissions -rw-r--r--
revset: add "matching" keyword This keyword can be used to find revisions that "match" one or more fields of a given set of revisions. A revision matches another if all the selected fields (description, author, branch, date, files, phase, parents, substate, user, summary and/or metadata) match the corresponding values of those fields on the source revision. By default this keyword looks for revisions that whose metadata match (description, author and date) making it ideal to look for duplicate revisions. matching takes 2 arguments (the second being optional): 1.- rev: a revset represeting a _single_ revision (e.g. tip, ., p1(.), etc) 2.- [field(s) to match]: an optional string containing the field or fields (separated by spaces) to match. Valid fields are most regular context fields and some special fields: * regular fields: - description, author, branch, date, files, phase, parents, substate, user. Note that author and user are synonyms. * special fields: summary, metadata. - summary: matches the first line of the description. - metatadata: It is equivalent to matching 'description user date' (i.e. it matches the main metadata fields). Examples: 1.- Look for revisions with the same metadata (author, description and date) as the 11th revision: hg log -r "matching(11)" 2.- Look for revisions with the same description as the 11th revision: hg log -r "matching(11, description)" 3.- Look for revisions with the same 'summary' (i.e. same first line on their description) as the 11th revision: hg log -r "matching(11, summary)" 4.- Look for revisions with the same author as the current revision: hg log -r "matching(., author)" You could use 'user' rather than 'author' to get the same result. 5.- Look for revisions with the same description _AND_ author as the tip of the repository: hg log -r "matching(tip, 'author description')" 6.- Look for revisions touching the same files as the parent of the tip of the repository hg log -r "matching(p1(tip), files)" 7.- Look for revisions whose subrepos are on the same state as the tip of the repository or its parent hg log -r "matching(p1(tip):tip, substate)" 8.- Look for revisions whose author and subrepo states both match those of any of the revisions on the stable branch: hg log -r "matching(branch(stable), 'author substate')"
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13017
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     1
  $ hg init repo
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     2
  $ cd repo
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     3
  $ hg init subrepo
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     4
  $ echo a > subrepo/a
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     5
  $ hg -R subrepo ci -Am adda
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     6
  adding a
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     7
  $ echo 'subrepo = subrepo' > .hgsub
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     8
  $ hg ci -Am addsubrepo
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     9
  adding .hgsub
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    10
  $ echo b > subrepo/b
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    11
  $ hg -R subrepo ci -Am addb
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    12
  adding b
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    13
  $ hg ci -m updatedsub
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    14
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    15
delete .hgsub and revert it
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    16
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    17
  $ rm .hgsub
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    18
  $ hg revert .hgsub
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    19
  warning: subrepo spec file .hgsub not found
14870
f73c7b70df68 subrepo: use working copy of .hgsub to filter status (issue2901)
Matt Mackall <mpm@selenic.com>
parents: 13017
diff changeset
    20
  warning: subrepo spec file .hgsub not found
13017
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    21
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    22
delete .hgsubstate and revert it
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    23
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    24
  $ rm .hgsubstate
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    25
  $ hg revert .hgsubstate
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    26
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    27
delete .hgsub and update
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    28
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    29
  $ rm .hgsub
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    30
  $ hg up 0
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    31
  warning: subrepo spec file .hgsub not found
14870
f73c7b70df68 subrepo: use working copy of .hgsub to filter status (issue2901)
Matt Mackall <mpm@selenic.com>
parents: 13017
diff changeset
    32
  warning: subrepo spec file .hgsub not found
13017
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    33
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    34
  $ hg st
14870
f73c7b70df68 subrepo: use working copy of .hgsub to filter status (issue2901)
Matt Mackall <mpm@selenic.com>
parents: 13017
diff changeset
    35
  warning: subrepo spec file .hgsub not found
13017
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    36
  ! .hgsub
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    37
  $ ls subrepo
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    38
  a
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    39
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    40
delete .hgsubstate and update
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    41
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    42
  $ hg up -C
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    43
  warning: subrepo spec file .hgsub not found
14870
f73c7b70df68 subrepo: use working copy of .hgsub to filter status (issue2901)
Matt Mackall <mpm@selenic.com>
parents: 13017
diff changeset
    44
  warning: subrepo spec file .hgsub not found
13017
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    45
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    46
  $ rm .hgsubstate
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    47
  $ hg up 0  
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    48
  remote changed .hgsubstate which local deleted
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    49
  use (c)hanged version or leave (d)eleted? c
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    50
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    51
  $ hg st
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    52
  $ ls subrepo
d0e21c5fde41 subrepo: handle missing subrepo spec file as removed
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    53
  a