tests/test-globalopts.t
changeset 12194 9e40ea08c2ab
parent 7429 dbc40381620e
child 12316 4134686b83e1
equal deleted inserted replaced
12193:927e1a677267 12194:9e40ea08c2ab
       
     1   $ "$TESTDIR/hghave" no-outer-repo || exit 80
       
     2 
       
     3   $ hg init a
       
     4   $ cd a
       
     5   $ echo a > a
       
     6   $ hg ci -A -d'1 0' -m a
       
     7   adding a
       
     8 
       
     9   $ cd ..
       
    10 
       
    11   $ hg init b
       
    12   $ cd b
       
    13   $ echo b > b
       
    14   $ hg ci -A -d'1 0' -m b
       
    15   adding b
       
    16 
       
    17   $ cd ..
       
    18 
       
    19   $ hg clone a c
       
    20   updating to branch default
       
    21   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    22   $ cd c
       
    23   $ hg pull -f ../b
       
    24   pulling from ../b
       
    25   searching for changes
       
    26   warning: repository is unrelated
       
    27   adding changesets
       
    28   adding manifests
       
    29   adding file changes
       
    30   added 1 changesets with 1 changes to 1 files (+1 heads)
       
    31   (run 'hg heads' to see heads, 'hg merge' to merge)
       
    32   $ hg merge
       
    33   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    34   (branch merge, don't forget to commit)
       
    35 
       
    36   $ cd ..
       
    37 
       
    38 Testing -R/--repository:
       
    39 
       
    40   $ hg -R a tip
       
    41   changeset:   0:8580ff50825a
       
    42   tag:         tip
       
    43   user:        test
       
    44   date:        Thu Jan 01 00:00:01 1970 +0000
       
    45   summary:     a
       
    46   
       
    47   $ hg --repository b tip
       
    48   changeset:   0:b6c483daf290
       
    49   tag:         tip
       
    50   user:        test
       
    51   date:        Thu Jan 01 00:00:01 1970 +0000
       
    52   summary:     b
       
    53   
       
    54 
       
    55 Implicit -R:
       
    56 
       
    57   $ hg ann a/a
       
    58   0: a
       
    59   $ hg ann a/a a/a
       
    60   0: a
       
    61   $ hg ann a/a b/b
       
    62   abort: There is no Mercurial repository here (.hg not found)!
       
    63   $ hg -R b ann a/a
       
    64   abort: a/a not under root
       
    65   $ hg log
       
    66   abort: There is no Mercurial repository here (.hg not found)!
       
    67 
       
    68 Abbreviation of long option:
       
    69 
       
    70   $ hg --repo c tip
       
    71   changeset:   1:b6c483daf290
       
    72   tag:         tip
       
    73   parent:      -1:000000000000
       
    74   user:        test
       
    75   date:        Thu Jan 01 00:00:01 1970 +0000
       
    76   summary:     b
       
    77   
       
    78 
       
    79 earlygetopt with duplicate options (36d23de02da1):
       
    80 
       
    81   $ hg --cwd a --cwd b --cwd c tip
       
    82   changeset:   1:b6c483daf290
       
    83   tag:         tip
       
    84   parent:      -1:000000000000
       
    85   user:        test
       
    86   date:        Thu Jan 01 00:00:01 1970 +0000
       
    87   summary:     b
       
    88   
       
    89   $ hg --repo c --repository b -R a tip
       
    90   changeset:   0:8580ff50825a
       
    91   tag:         tip
       
    92   user:        test
       
    93   date:        Thu Jan 01 00:00:01 1970 +0000
       
    94   summary:     a
       
    95   
       
    96 
       
    97 earlygetopt short option without following space:
       
    98 
       
    99   $ hg -q -Rb tip
       
   100   0:b6c483daf290
       
   101 
       
   102 earlygetopt with illegal abbreviations:
       
   103 
       
   104   $ hg --confi "foo.bar=baz"
       
   105   abort: option --config may not be abbreviated!
       
   106   $ hg --cw a tip
       
   107   abort: option --cwd may not be abbreviated!
       
   108   $ hg --rep a tip
       
   109   abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
       
   110   $ hg --repositor a tip
       
   111   abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
       
   112   $ hg -qR a tip
       
   113   abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
       
   114   $ hg -qRa tip
       
   115   abort: Option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
       
   116 
       
   117 Testing --cwd:
       
   118 
       
   119   $ hg --cwd a parents
       
   120   changeset:   0:8580ff50825a
       
   121   tag:         tip
       
   122   user:        test
       
   123   date:        Thu Jan 01 00:00:01 1970 +0000
       
   124   summary:     a
       
   125   
       
   126 
       
   127 Testing -y/--noninteractive - just be sure it is parsed:
       
   128 
       
   129   $ hg --cwd a tip -q --noninteractive
       
   130   0:8580ff50825a
       
   131   $ hg --cwd a tip -q -y
       
   132   0:8580ff50825a
       
   133 
       
   134 Testing -q/--quiet:
       
   135 
       
   136   $ hg -R a -q tip
       
   137   0:8580ff50825a
       
   138   $ hg -R b -q tip
       
   139   0:b6c483daf290
       
   140   $ hg -R c --quiet parents
       
   141   0:8580ff50825a
       
   142   1:b6c483daf290
       
   143 
       
   144 Testing -v/--verbose:
       
   145 
       
   146   $ hg --cwd c head -v
       
   147   changeset:   1:b6c483daf290
       
   148   tag:         tip
       
   149   parent:      -1:000000000000
       
   150   user:        test
       
   151   date:        Thu Jan 01 00:00:01 1970 +0000
       
   152   files:       b
       
   153   description:
       
   154   b
       
   155   
       
   156   
       
   157   changeset:   0:8580ff50825a
       
   158   user:        test
       
   159   date:        Thu Jan 01 00:00:01 1970 +0000
       
   160   files:       a
       
   161   description:
       
   162   a
       
   163   
       
   164   
       
   165   $ hg --cwd b tip --verbose
       
   166   changeset:   0:b6c483daf290
       
   167   tag:         tip
       
   168   user:        test
       
   169   date:        Thu Jan 01 00:00:01 1970 +0000
       
   170   files:       b
       
   171   description:
       
   172   b
       
   173   
       
   174   
       
   175 
       
   176 Testing --config:
       
   177 
       
   178   $ hg --cwd c --config paths.quuxfoo=bar paths | grep quuxfoo > /dev/null && echo quuxfoo
       
   179   quuxfoo
       
   180   $ hg --cwd c --config '' tip -q
       
   181   abort: malformed --config option: '' (use --config section.name=value)
       
   182   $ hg --cwd c --config a.b tip -q
       
   183   abort: malformed --config option: 'a.b' (use --config section.name=value)
       
   184   $ hg --cwd c --config a tip -q
       
   185   abort: malformed --config option: 'a' (use --config section.name=value)
       
   186   $ hg --cwd c --config a.= tip -q
       
   187   abort: malformed --config option: 'a.=' (use --config section.name=value)
       
   188   $ hg --cwd c --config .b= tip -q
       
   189   abort: malformed --config option: '.b=' (use --config section.name=value)
       
   190 
       
   191 Testing --debug:
       
   192 
       
   193   $ hg --cwd c log --debug
       
   194   changeset:   1:b6c483daf2907ce5825c0bb50f5716226281cc1a
       
   195   tag:         tip
       
   196   parent:      -1:0000000000000000000000000000000000000000
       
   197   parent:      -1:0000000000000000000000000000000000000000
       
   198   manifest:    1:23226e7a252cacdc2d99e4fbdc3653441056de49
       
   199   user:        test
       
   200   date:        Thu Jan 01 00:00:01 1970 +0000
       
   201   files+:      b
       
   202   extra:       branch=default
       
   203   description:
       
   204   b
       
   205   
       
   206   
       
   207   changeset:   0:8580ff50825a50c8f716709acdf8de0deddcd6ab
       
   208   parent:      -1:0000000000000000000000000000000000000000
       
   209   parent:      -1:0000000000000000000000000000000000000000
       
   210   manifest:    0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
       
   211   user:        test
       
   212   date:        Thu Jan 01 00:00:01 1970 +0000
       
   213   files+:      a
       
   214   extra:       branch=default
       
   215   description:
       
   216   a
       
   217   
       
   218   
       
   219 
       
   220 Testing --traceback:
       
   221 
       
   222   $ hg --cwd c --config x --traceback id 2>&1 | grep -i 'traceback'
       
   223   Traceback (most recent call last):
       
   224 
       
   225 Testing --time:
       
   226 
       
   227   $ hg --cwd a --time id
       
   228   8580ff50825a tip
       
   229   Time: real .*
       
   230 
       
   231 Testing --version:
       
   232 
       
   233   $ hg --version -q
       
   234   Mercurial Distributed SCM .*
       
   235 
       
   236 Testing -h/--help:
       
   237 
       
   238   $ hg -h
       
   239   Mercurial Distributed SCM
       
   240   
       
   241   list of commands:
       
   242   
       
   243    add          add the specified files on the next commit
       
   244    addremove    add all new files, delete all missing files
       
   245    annotate     show changeset information by line for each file
       
   246    archive      create an unversioned archive of a repository revision
       
   247    backout      reverse effect of earlier changeset
       
   248    bisect       subdivision search of changesets
       
   249    branch       set or show the current branch name
       
   250    branches     list repository named branches
       
   251    bundle       create a changegroup file
       
   252    cat          output the current or given revision of files
       
   253    clone        make a copy of an existing repository
       
   254    commit       commit the specified files or all outstanding changes
       
   255    copy         mark files as copied for the next commit
       
   256    diff         diff repository (or selected files)
       
   257    export       dump the header and diffs for one or more changesets
       
   258    forget       forget the specified files on the next commit
       
   259    grep         search for a pattern in specified files and revisions
       
   260    heads        show current repository heads or show branch heads
       
   261    help         show help for a given topic or a help overview
       
   262    identify     identify the working copy or specified revision
       
   263    import       import an ordered set of patches
       
   264    incoming     show new changesets found in source
       
   265    init         create a new repository in the given directory
       
   266    locate       locate files matching specific patterns
       
   267    log          show revision history of entire repository or files
       
   268    manifest     output the current or given revision of the project manifest
       
   269    merge        merge working directory with another revision
       
   270    outgoing     show changesets not found in the destination
       
   271    parents      show the parents of the working directory or revision
       
   272    paths        show aliases for remote repositories
       
   273    pull         pull changes from the specified source
       
   274    push         push changes to the specified destination
       
   275    recover      roll back an interrupted transaction
       
   276    remove       remove the specified files on the next commit
       
   277    rename       rename files; equivalent of copy + remove
       
   278    resolve      redo merges or set/view the merge status of files
       
   279    revert       restore individual files or directories to an earlier state
       
   280    rollback     roll back the last transaction (dangerous)
       
   281    root         print the root (top) of the current working directory
       
   282    serve        start stand-alone webserver
       
   283    showconfig   show combined config settings from all hgrc files
       
   284    status       show changed files in the working directory
       
   285    summary      summarize working directory state
       
   286    tag          add one or more tags for the current or given revision
       
   287    tags         list repository tags
       
   288    tip          show the tip revision
       
   289    unbundle     apply one or more changegroup files
       
   290    update       update working directory (or switch revisions)
       
   291    verify       verify the integrity of the repository
       
   292    version      output version and copyright information
       
   293   
       
   294   additional help topics:
       
   295   
       
   296    config       Configuration Files
       
   297    dates        Date Formats
       
   298    patterns     File Name Patterns
       
   299    environment  Environment Variables
       
   300    revisions    Specifying Single Revisions
       
   301    multirevs    Specifying Multiple Revisions
       
   302    revsets      Specifying Revision Sets
       
   303    diffs        Diff Formats
       
   304    templating   Template Usage
       
   305    urls         URL Paths
       
   306    extensions   Using additional features
       
   307    hgweb        Configuring hgweb
       
   308    glossary     Glossary
       
   309   
       
   310   use "hg -v help" to show aliases and global options
       
   311 
       
   312   $ hg --help
       
   313   Mercurial Distributed SCM
       
   314   
       
   315   list of commands:
       
   316   
       
   317    add          add the specified files on the next commit
       
   318    addremove    add all new files, delete all missing files
       
   319    annotate     show changeset information by line for each file
       
   320    archive      create an unversioned archive of a repository revision
       
   321    backout      reverse effect of earlier changeset
       
   322    bisect       subdivision search of changesets
       
   323    branch       set or show the current branch name
       
   324    branches     list repository named branches
       
   325    bundle       create a changegroup file
       
   326    cat          output the current or given revision of files
       
   327    clone        make a copy of an existing repository
       
   328    commit       commit the specified files or all outstanding changes
       
   329    copy         mark files as copied for the next commit
       
   330    diff         diff repository (or selected files)
       
   331    export       dump the header and diffs for one or more changesets
       
   332    forget       forget the specified files on the next commit
       
   333    grep         search for a pattern in specified files and revisions
       
   334    heads        show current repository heads or show branch heads
       
   335    help         show help for a given topic or a help overview
       
   336    identify     identify the working copy or specified revision
       
   337    import       import an ordered set of patches
       
   338    incoming     show new changesets found in source
       
   339    init         create a new repository in the given directory
       
   340    locate       locate files matching specific patterns
       
   341    log          show revision history of entire repository or files
       
   342    manifest     output the current or given revision of the project manifest
       
   343    merge        merge working directory with another revision
       
   344    outgoing     show changesets not found in the destination
       
   345    parents      show the parents of the working directory or revision
       
   346    paths        show aliases for remote repositories
       
   347    pull         pull changes from the specified source
       
   348    push         push changes to the specified destination
       
   349    recover      roll back an interrupted transaction
       
   350    remove       remove the specified files on the next commit
       
   351    rename       rename files; equivalent of copy + remove
       
   352    resolve      redo merges or set/view the merge status of files
       
   353    revert       restore individual files or directories to an earlier state
       
   354    rollback     roll back the last transaction (dangerous)
       
   355    root         print the root (top) of the current working directory
       
   356    serve        start stand-alone webserver
       
   357    showconfig   show combined config settings from all hgrc files
       
   358    status       show changed files in the working directory
       
   359    summary      summarize working directory state
       
   360    tag          add one or more tags for the current or given revision
       
   361    tags         list repository tags
       
   362    tip          show the tip revision
       
   363    unbundle     apply one or more changegroup files
       
   364    update       update working directory (or switch revisions)
       
   365    verify       verify the integrity of the repository
       
   366    version      output version and copyright information
       
   367   
       
   368   additional help topics:
       
   369   
       
   370    config       Configuration Files
       
   371    dates        Date Formats
       
   372    patterns     File Name Patterns
       
   373    environment  Environment Variables
       
   374    revisions    Specifying Single Revisions
       
   375    multirevs    Specifying Multiple Revisions
       
   376    revsets      Specifying Revision Sets
       
   377    diffs        Diff Formats
       
   378    templating   Template Usage
       
   379    urls         URL Paths
       
   380    extensions   Using additional features
       
   381    hgweb        Configuring hgweb
       
   382    glossary     Glossary
       
   383   
       
   384   use "hg -v help" to show aliases and global options
       
   385 
       
   386 Not tested: --debugger
       
   387