tests/test-narrow-trackedcmd.t
author Mathias De Mare <mathias.de_mare@nokia.com>
Wed, 17 Nov 2021 13:28:22 +0100
branchstable
changeset 48331 4713bcf78037
parent 47026 20eba5cef2e0
permissions -rw-r--r--
dockerrpm: always use current user and group Using uid 1000 and gid 1000 works by default in some cases, but 'id -u' and 'id -g' should work in all cases. Differential Revision: https://phab.mercurial-scm.org/D11767
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
39440
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
     1
#testcases flat tree
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
     2
  $ . "$TESTDIR/narrow-library.sh"
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
     3
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
     4
#if tree
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
     5
  $ cat << EOF >> $HGRCPATH
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
     6
  > [experimental]
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
     7
  > treemanifest = 1
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
     8
  > EOF
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
     9
#endif
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    10
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    11
  $ hg init master
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    12
  $ cd master
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    13
  $ cat >> .hg/hgrc <<EOF
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    14
  > [narrow]
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    15
  > serveellipses=True
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    16
  > EOF
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    17
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    18
  $ mkdir inside
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    19
  $ echo 'inside' > inside/f
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    20
  $ hg add inside/f
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    21
  $ hg commit -m 'add inside'
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    22
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    23
  $ mkdir widest
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    24
  $ echo 'widest' > widest/f
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    25
  $ hg add widest/f
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    26
  $ hg commit -m 'add widest'
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    27
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    28
  $ mkdir outside
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    29
  $ echo 'outside' > outside/f
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    30
  $ hg add outside/f
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    31
  $ hg commit -m 'add outside'
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    32
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    33
  $ cd ..
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    34
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    35
narrow clone the inside file
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    36
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    37
  $ hg clone --narrow ssh://user@dummy/master narrow --include inside
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    38
  requesting all changes
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    39
  adding changesets
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    40
  adding manifests
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    41
  adding file changes
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    42
  added 2 changesets with 1 changes to 1 files
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    43
  new changesets *:* (glob)
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    44
  updating to branch default
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    45
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    46
  $ cd narrow
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    47
  $ hg tracked
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    48
  I path:inside
44724
5c2a4f37eace tests: deal with "ls" vs "ls -A" difference on 2BSD derived systems
Joerg Sonnenberger <joerg@bec.de>
parents: 42945
diff changeset
    49
  $ ls -A
5c2a4f37eace tests: deal with "ls" vs "ls -A" difference on 2BSD derived systems
Joerg Sonnenberger <joerg@bec.de>
parents: 42945
diff changeset
    50
  .hg
39440
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    51
  inside
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    52
  $ cat inside/f
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    53
  inside
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    54
  $ cd ..
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    55
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    56
add more upstream files which we will include in a wider narrow spec
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    57
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    58
  $ cd master
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    59
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    60
  $ mkdir wider
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    61
  $ echo 'wider' > wider/f
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    62
  $ hg add wider/f
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    63
  $ echo 'widest v2' > widest/f
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    64
  $ hg commit -m 'add wider, update widest'
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    65
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    66
  $ echo 'widest v3' > widest/f
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    67
  $ hg commit -m 'update widest v3'
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    68
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    69
  $ echo 'inside v2' > inside/f
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    70
  $ hg commit -m 'update inside'
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    71
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    72
  $ mkdir outside2
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    73
  $ echo 'outside2' > outside2/f
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    74
  $ hg add outside2/f
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    75
  $ hg commit -m 'add outside2'
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    76
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    77
  $ echo 'widest v4' > widest/f
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    78
  $ hg commit -m 'update widest v4'
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    79
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    80
  $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    81
  7: update widest v4
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    82
  6: add outside2
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    83
  5: update inside
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    84
  4: update widest v3
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    85
  3: add wider, update widest
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    86
  2: add outside
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    87
  1: add widest
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    88
  0: add inside
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    89
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    90
  $ cd ..
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    91
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    92
Testing the --import-rules flag of `hg tracked` command
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    93
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    94
  $ cd narrow
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    95
  $ hg tracked --import-rules
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    96
  hg tracked: option --import-rules requires argument
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    97
  hg tracked [OPTIONS]... [REMOTE]
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    98
  
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
    99
  show or change the current narrowspec
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   100
  
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   101
  options ([+] can be repeated):
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   102
  
41009
fcc0a7ac9ebd help: show "[no-]" only for default-on Flags
Martin von Zweigbergk <martinvonz@google.com>
parents: 40955
diff changeset
   103
      --addinclude VALUE [+]       new paths to include
fcc0a7ac9ebd help: show "[no-]" only for default-on Flags
Martin von Zweigbergk <martinvonz@google.com>
parents: 40955
diff changeset
   104
      --removeinclude VALUE [+]    old paths to no longer include
42945
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42807
diff changeset
   105
      --auto-remove-includes       automatically choose unused includes to
40f78072fda9 narrow: add option for automatically removing unused includes
Martin von Zweigbergk <martinvonz@google.com>
parents: 42807
diff changeset
   106
                                   remove
41009
fcc0a7ac9ebd help: show "[no-]" only for default-on Flags
Martin von Zweigbergk <martinvonz@google.com>
parents: 40955
diff changeset
   107
      --addexclude VALUE [+]       new paths to exclude
fcc0a7ac9ebd help: show "[no-]" only for default-on Flags
Martin von Zweigbergk <martinvonz@google.com>
parents: 40955
diff changeset
   108
      --import-rules VALUE         import narrowspecs from a file
fcc0a7ac9ebd help: show "[no-]" only for default-on Flags
Martin von Zweigbergk <martinvonz@google.com>
parents: 40955
diff changeset
   109
      --removeexclude VALUE [+]    old paths to no longer exclude
fcc0a7ac9ebd help: show "[no-]" only for default-on Flags
Martin von Zweigbergk <martinvonz@google.com>
parents: 40955
diff changeset
   110
      --clear                      whether to replace the existing narrowspec
fcc0a7ac9ebd help: show "[no-]" only for default-on Flags
Martin von Zweigbergk <martinvonz@google.com>
parents: 40955
diff changeset
   111
      --force-delete-local-changes forces deletion of local changes when
41010
e8e2a7656e83 help: hide default value for default-off flags
Martin von Zweigbergk <martinvonz@google.com>
parents: 41009
diff changeset
   112
                                   narrowing
46477
3c360ab2688d narrow: add --no-backup option for narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46262
diff changeset
   113
      --[no-]backup                back up local changes when narrowing
3c360ab2688d narrow: add --no-backup option for narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46262
diff changeset
   114
                                   (default: on)
41043
ce0bc2952e2a narrow: detect if narrowspec was changed in a different share
Martin von Zweigbergk <martinvonz@google.com>
parents: 41027
diff changeset
   115
      --update-working-copy        update working copy when the store has
ce0bc2952e2a narrow: detect if narrowspec was changed in a different share
Martin von Zweigbergk <martinvonz@google.com>
parents: 41027
diff changeset
   116
                                   changed
41009
fcc0a7ac9ebd help: show "[no-]" only for default-on Flags
Martin von Zweigbergk <martinvonz@google.com>
parents: 40955
diff changeset
   117
   -e --ssh CMD                    specify ssh command to use
fcc0a7ac9ebd help: show "[no-]" only for default-on Flags
Martin von Zweigbergk <martinvonz@google.com>
parents: 40955
diff changeset
   118
      --remotecmd CMD              specify hg command to run on the remote side
fcc0a7ac9ebd help: show "[no-]" only for default-on Flags
Martin von Zweigbergk <martinvonz@google.com>
parents: 40955
diff changeset
   119
      --insecure                   do not verify server certificate (ignoring
fcc0a7ac9ebd help: show "[no-]" only for default-on Flags
Martin von Zweigbergk <martinvonz@google.com>
parents: 40955
diff changeset
   120
                                   web.cacerts config)
39440
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   121
  
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   122
  (use 'hg tracked -h' to show more help)
46262
9c9e0b4b2ca7 error: use detailed exit code 10 for command errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 46117
diff changeset
   123
  [10]
39440
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   124
  $ hg tracked --import-rules doesnotexist
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   125
  abort: cannot read narrowspecs from '$TESTTMP/narrow/doesnotexist': $ENOENT$
46117
6cc269bd1c29 errors: raise more specifc errors from narrowcommands
Martin von Zweigbergk <martinvonz@google.com>
parents: 44724
diff changeset
   126
  [50]
39440
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   127
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   128
  $ cat > specs <<EOF
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   129
  > %include foo
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   130
  > [include]
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   131
  > path:widest/
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   132
  > [exclude]
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   133
  > path:inside/
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   134
  > EOF
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   135
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   136
  $ hg tracked --import-rules specs
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   137
  abort: including other spec files using '%include' is not supported in narrowspec
46117
6cc269bd1c29 errors: raise more specifc errors from narrowcommands
Martin von Zweigbergk <martinvonz@google.com>
parents: 44724
diff changeset
   138
  [10]
39440
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   139
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   140
  $ cat > specs <<EOF
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   141
  > [include]
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   142
  > outisde
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   143
  > [exclude]
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   144
  > inside
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   145
  > EOF
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   146
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   147
  $ hg tracked --import-rules specs
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   148
  comparing with ssh://user@dummy/master
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   149
  searching for changes
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   150
  looking for local changes to affected paths
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   151
  deleting data/inside/f.i
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   152
  deleting meta/inside/00manifest.i (tree !)
47026
20eba5cef2e0 narrow: add more status messages when narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46477
diff changeset
   153
  deleting unwanted files from working copy
39440
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   154
  saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob)
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   155
  adding changesets
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   156
  adding manifests
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   157
  adding file changes
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   158
  added 2 changesets with 0 changes to 0 files
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   159
  $ hg tracked
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   160
  I path:outisde
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   161
  X path:inside
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   162
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   163
Testing the --import-rules flag with --addinclude and --addexclude
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   164
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   165
  $ cat > specs <<EOF
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   166
  > [include]
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   167
  > widest
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   168
  > EOF
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   169
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   170
  $ hg tracked --import-rules specs --addinclude 'wider/'
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   171
  comparing with ssh://user@dummy/master
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   172
  searching for changes
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   173
  saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob)
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   174
  adding changesets
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   175
  adding manifests
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   176
  adding file changes
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   177
  added 3 changesets with 1 changes to 1 files
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   178
  $ hg tracked
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   179
  I path:outisde
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   180
  I path:wider
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   181
  I path:widest
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   182
  X path:inside
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   183
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   184
  $ cat > specs <<EOF
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   185
  > [exclude]
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   186
  > outside2
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   187
  > EOF
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   188
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   189
  $ hg tracked --import-rules specs --addexclude 'widest'
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   190
  comparing with ssh://user@dummy/master
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   191
  searching for changes
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   192
  looking for local changes to affected paths
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   193
  deleting data/widest/f.i
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   194
  deleting meta/widest/00manifest.i (tree !)
47026
20eba5cef2e0 narrow: add more status messages when narrowing
Martin von Zweigbergk <martinvonz@google.com>
parents: 46477
diff changeset
   195
  deleting unwanted files from working copy
39440
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   196
  $ hg tracked
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   197
  I path:outisde
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   198
  I path:wider
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   199
  X path:inside
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   200
  X path:outside2
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   201
  X path:widest
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   202
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   203
  $ hg tracked --import-rules specs --clear
41027
74e023f5a922 narrow: replace "ui.warn(); return 1" by "raise error.Abort()"
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   204
  abort: the --clear option is not yet supported
46117
6cc269bd1c29 errors: raise more specifc errors from narrowcommands
Martin von Zweigbergk <martinvonz@google.com>
parents: 44724
diff changeset
   205
  [10]
39440
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   206
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   207
Testing with passing a out of wdir file
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   208
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   209
  $ cat > ../nspecs <<EOF
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   210
  > [include]
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   211
  > widest
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   212
  > EOF
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   213
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   214
  $ hg tracked --import-rules ../nspecs
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   215
  comparing with ssh://user@dummy/master
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   216
  searching for changes
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   217
  saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob)
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   218
  adding changesets
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   219
  adding manifests
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   220
  adding file changes
ab20ee07b82d narrow: add '--import-rules' flag to tracked command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
diff changeset
   221
  added 3 changesets with 0 changes to 0 files
41723
ebbc4e70ebd1 narrow: fix command name in error messsage
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 41043
diff changeset
   222
ebbc4e70ebd1 narrow: fix command name in error messsage
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 41043
diff changeset
   223
  $ cd ..
ebbc4e70ebd1 narrow: fix command name in error messsage
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 41043
diff changeset
   224
ebbc4e70ebd1 narrow: fix command name in error messsage
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 41043
diff changeset
   225
Testing tracked command on a non-narrow repo
ebbc4e70ebd1 narrow: fix command name in error messsage
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 41043
diff changeset
   226
ebbc4e70ebd1 narrow: fix command name in error messsage
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 41043
diff changeset
   227
  $ hg init non-narrow
ebbc4e70ebd1 narrow: fix command name in error messsage
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 41043
diff changeset
   228
  $ cd non-narrow
ebbc4e70ebd1 narrow: fix command name in error messsage
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 41043
diff changeset
   229
  $ hg tracked --addinclude foobar
42807
383fdfa6bba9 narrow: fix typo "respositories"
Martin von Zweigbergk <martinvonz@google.com>
parents: 42415
diff changeset
   230
  abort: the tracked command is only supported on repositories cloned with --narrow
46117
6cc269bd1c29 errors: raise more specifc errors from narrowcommands
Martin von Zweigbergk <martinvonz@google.com>
parents: 44724
diff changeset
   231
  [10]