hg.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Wed, 05 Aug 2015 23:55:34 +0300
changeset 1729 22ffd80639c0
parent 1688 5493b5425eba
child 1855 3880fb7d6d2a
permissions -rw-r--r--
Make centered content design with adoption for mobile devices. Highlight TOC.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1334
9bf0d5a1f0cf Include common header with quick links.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1090
diff changeset
     1
.. -*- coding: utf-8; -*-
9bf0d5a1f0cf Include common header with quick links.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1090
diff changeset
     2
.. include:: HEADER.rst
1001
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     3
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     4
============
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
 Mercurial.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     6
============
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     7
.. contents::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     9
About.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    10
======
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    11
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    12
  http://mercurial.selenic.com/wiki/ProjectsUsingMercurial
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    13
                Some Projects that Use Mercurial
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    14
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    15
User config.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    16
============
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    17
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    18
Put to your ~/.hgrc::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    19
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    20
  [ui]
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    21
  ; Editor for editing commit message.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    22
  editor = gvim
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    23
  ; Who commit.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    24
  username = Oleksandr Gavenko <gavenkoa@gmail.com>
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    25
  ; Use internal merge algorithm, which mark conflict like <<<<<< ====== >>>>>>.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    26
  ; Save previous file version in '*.orig' file, after merge must be marked as
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    27
  ; resolved by running 'hg resolve -m <file>'.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    28
  merge = internal:merge
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    29
  [web]
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    30
  ; Default encoding for file hosted by 'hg serv'.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    31
  encoding = utf-8
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    32
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    33
Multiline log message for log command.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    34
--------------------------------------
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    35
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    36
By default 'hg log' show only first line of log message. To see all message
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    37
run::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    38
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    39
  $ hg log -v
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    40
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    41
or put into ~/.hgrc::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    42
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    43
  [defaults]
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    44
  log = -v
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    45
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    46
Follow history ever when file copied.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    47
-------------------------------------
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    48
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    49
By default 'hg log' show only history after last file copy. To see log message
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    50
before copying run::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    51
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    52
  $ hg log -f
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    53
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    54
or put into ~/.hgrc::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    55
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    56
  [defaults]
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    57
  log = -f
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    58
1659
7dc153b728f7 Rebase draft (unpublished) changes over public changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1647
diff changeset
    59
Show supported/loaded plugin.
7dc153b728f7 Rebase draft (unpublished) changes over public changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1647
diff changeset
    60
=============================
7dc153b728f7 Rebase draft (unpublished) changes over public changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1647
diff changeset
    61
::
7dc153b728f7 Rebase draft (unpublished) changes over public changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1647
diff changeset
    62
7dc153b728f7 Rebase draft (unpublished) changes over public changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1647
diff changeset
    63
  $ hg help extensions
7dc153b728f7 Rebase draft (unpublished) changes over public changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1647
diff changeset
    64
  $ hg showconfig extensions
7dc153b728f7 Rebase draft (unpublished) changes over public changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1647
diff changeset
    65
1001
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    66
Useful extension.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    67
=================
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    68
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    69
Put to your ~/.hgrc:
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    70
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    71
  [extensions]
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    72
  ; To allow 'fetch' command.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    73
  hgext.fetch =
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    74
  ; To allow Mercurial Queues.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    75
  hgext.mq =
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    76
  ; To import revisions from foreign VCS repositories into Mercurial.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    77
  hgext.convert =
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    78
  ; Usage:  hg glog <dir>
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    79
  hgext.graphlog =
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    80
  ; Enable '.hgeol' tracking (fix for CR/LF).
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    81
  hgext.eol =
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    82
1647
107b566e7a12 Show diff against 2 parents or base during merge.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1646
diff changeset
    83
Show diff against 2 parents or base during merge.
107b566e7a12 Show diff against 2 parents or base during merge.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1646
diff changeset
    84
=================================================
107b566e7a12 Show diff against 2 parents or base during merge.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1646
diff changeset
    85
::
107b566e7a12 Show diff against 2 parents or base during merge.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1646
diff changeset
    86
107b566e7a12 Show diff against 2 parents or base during merge.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1646
diff changeset
    87
  hg diff -r 'p1()'
107b566e7a12 Show diff against 2 parents or base during merge.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1646
diff changeset
    88
  hg diff -r 'p2()'
107b566e7a12 Show diff against 2 parents or base during merge.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1646
diff changeset
    89
  hg diff -r 'ancestor(p1(), p2())'
107b566e7a12 Show diff against 2 parents or base during merge.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1646
diff changeset
    90
1001
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    91
Downgrade repository format.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    92
============================
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    93
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    94
To get list of supported repo formats type::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    95
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    96
  $ hg help config
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    97
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    98
and look for "format" section. To be Mercurial 0.9.4 compatible use::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    99
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   100
  $ hg clone -U --pull \
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   101
    --config format.usefncache=0 --config format.dotencode=0 $oldr $newr
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   102
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   103
Clone specific branches.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   104
========================
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   105
::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   106
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   107
  $ hg clone http://your/repo -r $branch
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   108
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   109
Closing branches.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   110
=================
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   111
::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   112
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   113
  $ hg branches
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   114
  $branch (inactive)
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   115
  ...
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   116
  $ hg branches -a
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   117
  ...                     # no $branch
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   118
  $ hg up -r $branch
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   119
  $ hg ci --close-branch -m "Bla-bla-bla"
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   120
  $ hg up -r default
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   121
  $ hg branches
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   122
  ...                     # no $branch
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   123
  $ hg branches -c
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   124
  $branch (inactive)
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   125
  ...
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   126
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   127
To reopen closed branch just update to it and commit anything!
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   128
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   129
Remove/rename files history from repo.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   130
======================================
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   131
::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   132
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   133
  $ cat >filemap.txt <<EOF
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   134
  exclude path/to/file-or-dir
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   135
  rename path/to/source path/to/destination
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   136
  ...
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   137
  EOF
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   138
  $ hg convert --filemap filemap.txt $repo_orig $repo_new
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   139
  $ hg -R $repo_new up
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   140
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   141
See:
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   142
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   143
  http://mercurial.selenic.com/wiki/ConvertExtension
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   144
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   145
Fix branch names.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   146
-----------------
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   147
::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   148
1645
7fb7a32336a2 Fix spelling.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1605
diff changeset
   149
  $ hg convert --branchmap $branchmapfile oldrepo newrepo
1001
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   150
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   151
To convert non-ASCII names use UTF-8 coding for 'branchmap' file.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   152
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   153
When converted names with spaces only last space in 'branchmap' file treat as
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   154
separator between old branch name and new, so new branch name can not contain
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   155
spaces.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   156
1645
7fb7a32336a2 Fix spelling.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1605
diff changeset
   157
Joining history of two repos.
7fb7a32336a2 Fix spelling.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1605
diff changeset
   158
=============================
1001
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   159
::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   160
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   161
  $ cat >filemap1.txt <<EOF
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   162
  rename . dir1
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   163
  EOF
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   164
  $ cat >filemap2.txt <<EOF
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   165
  rename . dir2
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   166
  EOF
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   167
  $ hg convert --filemap filemap1.txt $repo1 $repo_new
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   168
  $ hg convert --filemap filemap2.txt $repo2 $repo_new
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   169
  $ hg -R $repo_new merge
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   170
  $ hg -R $repo_new ci -m "Join $repo1 and $repo2."
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   171
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   172
Publishing repo.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   173
================
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   174
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   175
With static HTTP hosting you can copy via rsync, ftp, scp, etc., so long as all
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   176
the files beneath .hg are copied. Also since 1.1 pull protocol can detect static
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   177
HTTP hosting::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   178
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   179
  $ hg clone http://example.com/project
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   180
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   181
See:
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   182
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   183
  http://mercurial.selenic.com/wiki/hgserve
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   184
  http://mercurial.selenic.com/wiki/HgWebDirStepByStep
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   185
  http://mercurial.selenic.com/wiki/StaticHTTP
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   186
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   187
hgweb.config.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   188
-------------
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   189
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   190
Set allowed project by specifying paths to they (keys are URL, values are fs
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   191
paths)::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   192
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   193
  [paths]
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   194
  myproject = /home/user/hg/myproject
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   195
  otherproject = /home/user/hg/otherproject
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   196
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   197
You can use single wildcard '*' to search current subdirs or double wildcard
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   198
'**' to search subdirs recursively::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   199
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   200
  [paths]
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   201
  myproject = /home/user/hg/my/*
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   202
  otherproject = /home/user/hg/other/**
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   203
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   204
Alternatively you can set a collection of repos (keys and values are both
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   205
filesystem paths, keys should be prefixes of the values and are "subtracted"
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   206
from the values in order to generate the URL paths to each repository)::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   207
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   208
  [collections]
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   209
  /home/user/hg = /home/user/hg
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   210
  /home/another/hg = /home/another/hg
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   211
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   212
Allow archive downloads::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   213
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   214
  [web]
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   215
  allow_archive = gz, zip, bz2
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   216
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   217
Make web page look nice::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   218
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   219
  [web]
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   220
  # Use 'cd /lib/python2.x/site-packages/mercurial/templates; find . -type d' to see available
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   221
  # styles. Some interesting: gitweb, coal, monoblue.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   222
  style = gitweb
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   223
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   224
Set another settings::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   225
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   226
  [web]
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   227
  encoding = UTF-8
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   228
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   229
  maxchanges = 100
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   230
  maxfiles = 100
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   231
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   232
In each $proj/.hg/hgrc put::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   233
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   234
  [web]
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   235
  contact = ADMIN <admin@example.com>
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   236
  description = <p style="color: red;">$proj</b> allow make a <a href="http://example.com">BIG Thing.</a>
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   237
  # Do not use name, in this case you see dir name where project lcated.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   238
  # name = $proj
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   239
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   240
To allow push in 'hg serv'::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   241
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   242
  [web]
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   243
  allow_push = *
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   244
  push_ssl = false
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   245
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   246
See:
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   247
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   248
  http://mercurial.selenic.com/wiki/PublishingRepositories
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   249
                Publishing Mercurial Repositories
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   250
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   251
init.d script.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   252
--------------
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   253
::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   254
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   255
  #!/bin/sh
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   256
  CMD=/usr/bin/hg
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   257
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   258
  PORT=7878
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   259
  SRC=/srv/hg
1645
7fb7a32336a2 Fix spelling.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1605
diff changeset
   260
  CONFIG=/srv/hg/hgweb.config
1001
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   261
  PIDFILE=/var/run/hg.pid
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   262
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   263
  case "$1" in
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   264
  start)
1645
7fb7a32336a2 Fix spelling.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1605
diff changeset
   265
    echo "Mercurial Server service starting."
1001
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   266
    (cd "$SRC"; $CMD serve -d -p $PORT --pid-file "$PIDFILE")
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   267
    ;;
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   268
  stop)
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   269
    if [ -f "$PIDFILE" ]; then
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   270
      PID=`cat "$PIDFILE"`
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   271
      if [ "$PID" -gt 1 ]; then
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   272
        kill -TERM $PID
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   273
        echo "Stopping the Mercurial service PID=$PID."
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   274
      else
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   275
        echo Bad PID for Mercurial -- \"$PID\".
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   276
        echo You may remove \"$PIDFILE\" manually.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   277
      fi
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   278
    else
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   279
      echo No PID file recorded for mercurial.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   280
    fi
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   281
    ;;
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   282
  *)
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   283
    echo "$0 {start|stop}"
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   284
    exit 1
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   285
    ;;
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   286
  esac
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   287
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   288
See:
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   289
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   290
  http://mercurial.selenic.com/wiki/hgserve
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   291
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   292
Manage patches with MQ.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   293
=======================
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   294
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   295
First enable MQ, add following to your ~/.hgrc::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   296
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   297
  [extensions]
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   298
  hgext.mq =
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   299
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   300
Second get unpatched sources and put it to hg repository::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   301
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   302
  $ tar zxf proj-x.y.z.tar.gz
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   303
  $ mv proj-x.y.z proj
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   304
  $ cd proj
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   305
  $ hg init
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   306
  $ hg ci -m "Added x.y.z version of proj."
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   307
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   308
Init MQ and take name for first patch::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   309
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   310
  $ hg qinit
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   311
  $ hg qnew first.patch
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   312
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   313
Next make changes by editing source and save it to patch::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   314
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   315
  $ $EDITOR file.c
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   316
  ...
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   317
  $ hg diff
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   318
  ...
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   319
  $ hg qrefresh
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   320
  $ hg diff      # <-- have zero diff
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   321
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   322
You can make second patch by applying existing one::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   323
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   324
  $ hg qnew second.patch
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   325
  $ patch -p1 <bugfix.patch
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   326
  $ hg qrefresh
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   327
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   328
You can take list of patches (from old to new) and revert or apply patches by
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   329
qpop/qpush command::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   330
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   331
  $ hg qseries   # <-- what patches have
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   332
  first.patch
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   333
  second.patch
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   334
  $ hg qapplied  # <-- what patches applied
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   335
  first.patch
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   336
  second.patch
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   337
  $ hg qpop
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   338
  $ hg qseries
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   339
  first.patch
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   340
  second.patch
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   341
  $ hg qapplied
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   342
  first.patch
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   343
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   344
You can revert or apply all patches by single command::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   345
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   346
  $ hg qpop -a
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   347
  $ hg qpush -a
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   348
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   349
You can delete patch from patch list (before that you need de-apply patch)::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   350
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   351
  $ hg qpop -a
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   352
  $ hg qdelete first.patch
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   353
1645
7fb7a32336a2 Fix spelling.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1605
diff changeset
   354
To add new version of source and fix patches for it first de-apply patches,
1001
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   355
then pull new changes and try apply patches on top of new sources::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   356
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   357
  $ hg qpop -a
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   358
  $ rm *       # .hg dir not deleted because its name start with dot
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   359
  $ cd ..
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   360
  $ tar zxf proj-a.b.c.tar.gz
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   361
  $ cp -R proj-a.b.c/* proj
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   362
  $ cd proj
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   363
  $ hg addremove -s 70
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   364
  $ hg ci -m "Added a.b.c version of proj."
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   365
  $ hg qpush -a
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   366
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   367
To apply series of already done patches use::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   368
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   369
  $ ls /path/to/bugfixes/*.patch | xargs hg qimport
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   370
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   371
You can fix patch description message from command line::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   372
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   373
  $ hg qser -s
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   374
  makefile-doc.patch:
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   375
  $ hg qpush
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   376
  applying makefile-doc.patch
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   377
  now at: makefile-doc.patch
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   378
  $ hg qref -m 'Add description about Makefile usage.'
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   379
  $ hg qser -s
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   380
  makefile-doc.patch: Add description about Makefile usage.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   381
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   382
or from editor by::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   383
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   384
  $ hg qref -e
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   385
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   386
Remove all patches from MQ.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   387
===========================
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   388
::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   389
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   390
  $ hg qpop -a
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   391
  $ for patch in `hg qser`; do hg qrm $patch; done
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   392
1668
86a2cb376ee9 Moving changes from MQ to working tree.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1667
diff changeset
   393
Moving changes from MQ to working tree.
86a2cb376ee9 Moving changes from MQ to working tree.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1667
diff changeset
   394
=======================================
86a2cb376ee9 Moving changes from MQ to working tree.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1667
diff changeset
   395
::
86a2cb376ee9 Moving changes from MQ to working tree.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1667
diff changeset
   396
86a2cb376ee9 Moving changes from MQ to working tree.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1667
diff changeset
   397
  $ hg qpop my.patch
86a2cb376ee9 Moving changes from MQ to working tree.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1667
diff changeset
   398
  $ hg qdel --keep my.patch
86a2cb376ee9 Moving changes from MQ to working tree.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1667
diff changeset
   399
  $ patch -p1 .hg/patches/my.patch
86a2cb376ee9 Moving changes from MQ to working tree.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1667
diff changeset
   400
  $ rm .hg/patches/my.patch
86a2cb376ee9 Moving changes from MQ to working tree.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1667
diff changeset
   401
1667
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   402
Split patch in MQ.
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   403
==================
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   404
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   405
Enable built-in extensions::
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   406
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   407
  [extensions]
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   408
  mq=
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   409
  record=
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   410
  shelve=
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   411
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   412
Then move MQ into working tree and split changes and remove original patch::
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   413
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   414
  $ hg qpop my.patch
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   415
  $ patch -p1 <.hg/patches/my.patch
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   416
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   417
  $ hg qnew -i my1.patch
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   418
   ....
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   419
  $ hg qnew -i my2.patch
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   420
   ....
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   421
  $ hg qnew myN.patch   # last without interactive stuff
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   422
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   423
  $ hg qdelete --keep my.patch
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   424
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   425
Between ``my$i.patch`` and ``my$((i+1)).patch`` you can use ``hg shelve``/``hg
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   426
unshelve`` to test if project built and pass tests on top of ``my$i.patch``
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   427
without later changes!
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   428
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   429
If you find that something missing on this stage use ``hg qref`` on shelved
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   430
changes or ``hg qref -i`` on unshelved changes!
40bb400c925e Split patch in MQ.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1660
diff changeset
   431
1001
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   432
Proxy.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   433
======
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   434
::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   435
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   436
  $ hg clone --config http_proxy.host=$host:$port \
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   437
    --config http_proxy.user=$user --config http_proxy.passwd=$password  $addr
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   438
1605
41ef0417d899 Shelve/stash uncommitted changes. shelve extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   439
Shelve/stash uncommitted changes.
41ef0417d899 Shelve/stash uncommitted changes. shelve extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   440
=================================
41ef0417d899 Shelve/stash uncommitted changes. shelve extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   441
41ef0417d899 Shelve/stash uncommitted changes. shelve extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   442
Enable ``shelve`` extension::
41ef0417d899 Shelve/stash uncommitted changes. shelve extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   443
41ef0417d899 Shelve/stash uncommitted changes. shelve extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   444
  [extensions]
41ef0417d899 Shelve/stash uncommitted changes. shelve extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   445
  shelve=
41ef0417d899 Shelve/stash uncommitted changes. shelve extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   446
41ef0417d899 Shelve/stash uncommitted changes. shelve extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   447
and::
41ef0417d899 Shelve/stash uncommitted changes. shelve extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   448
41ef0417d899 Shelve/stash uncommitted changes. shelve extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   449
  $ hg shelve
41ef0417d899 Shelve/stash uncommitted changes. shelve extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   450
  $ hg fetch
41ef0417d899 Shelve/stash uncommitted changes. shelve extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   451
  $ hg unshelve
41ef0417d899 Shelve/stash uncommitted changes. shelve extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   452
41ef0417d899 Shelve/stash uncommitted changes. shelve extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   453
Or use MQ::
41ef0417d899 Shelve/stash uncommitted changes. shelve extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   454
41ef0417d899 Shelve/stash uncommitted changes. shelve extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   455
  $ hg qnew tmp.patch
41ef0417d899 Shelve/stash uncommitted changes. shelve extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   456
  $ hg qpop
41ef0417d899 Shelve/stash uncommitted changes. shelve extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   457
  $ hg fetch
41ef0417d899 Shelve/stash uncommitted changes. shelve extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   458
  $ hg qpush
41ef0417d899 Shelve/stash uncommitted changes. shelve extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   459
41ef0417d899 Shelve/stash uncommitted changes. shelve extension.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   460
Or with plain patch::
1001
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   461
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   462
  $ hg diff > .diff   # save local changes
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   463
  $ hg revert -a
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   464
  $ hg fetch
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   465
  $ patch -p1 <.diff
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   466
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   467
See:
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   468
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   469
  http://mercurial.selenic.com/wiki/TipsAndTricks#Merge_or_rebase_with_uncommitted_changes
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   470
  http://mercurial.selenic.com/wiki/ShelveExtension
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   471
1659
7dc153b728f7 Rebase draft (unpublished) changes over public changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1647
diff changeset
   472
Rebase.
7dc153b728f7 Rebase draft (unpublished) changes over public changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1647
diff changeset
   473
=======
7dc153b728f7 Rebase draft (unpublished) changes over public changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1647
diff changeset
   474
7dc153b728f7 Rebase draft (unpublished) changes over public changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1647
diff changeset
   475
SVN like update::
7dc153b728f7 Rebase draft (unpublished) changes over public changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1647
diff changeset
   476
7dc153b728f7 Rebase draft (unpublished) changes over public changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1647
diff changeset
   477
  $ hg pull --rebase
7dc153b728f7 Rebase draft (unpublished) changes over public changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1647
diff changeset
   478
1688
5493b5425eba limit merge only to current branch
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1668
diff changeset
   479
Rebase draft (unpublished) changes over public changes if one one head::
1659
7dc153b728f7 Rebase draft (unpublished) changes over public changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1647
diff changeset
   480
7dc153b728f7 Rebase draft (unpublished) changes over public changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1647
diff changeset
   481
  $ hg rebase -s 'draft()' -d 'public()'
1660
71e627dc8b8c it possible that you isn't on a tip
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1659
diff changeset
   482
  $ hg up  # it possible that you isn't on a tip
1659
7dc153b728f7 Rebase draft (unpublished) changes over public changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1647
diff changeset
   483
1688
5493b5425eba limit merge only to current branch
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1668
diff changeset
   484
If you want to limit merge only to current branch::
5493b5425eba limit merge only to current branch
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1668
diff changeset
   485
5493b5425eba limit merge only to current branch
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1668
diff changeset
   486
  $ hg rebase -s 'draft() & branch(.)' -d 'public() & branch(.)'
5493b5425eba limit merge only to current branch
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1668
diff changeset
   487
1024
dd94730a04f4 Fix section name.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1023
diff changeset
   488
Find greatest common ancestor of changesets.
dd94730a04f4 Fix section name.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1023
diff changeset
   489
============================================
1090
d362fd4a1995 Fix RST syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1088
diff changeset
   490
::
1023
d8c88154a28f Find greatest common ancestor of the two changesets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1001
diff changeset
   491
d8c88154a28f Find greatest common ancestor of the two changesets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1001
diff changeset
   492
  $ hg help revsets
d8c88154a28f Find greatest common ancestor of the two changesets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1001
diff changeset
   493
  $ hg log -r "ancestor($rev1,$rev2)"
d8c88154a28f Find greatest common ancestor of the two changesets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1001
diff changeset
   494
  $ hg log -r "ancestor($rev1,ancestor($rev2,$rev3))"
d8c88154a28f Find greatest common ancestor of the two changesets.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1001
diff changeset
   495
1088
90fc62d6693e Find most recent tag for revision.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1032
diff changeset
   496
Find most recent tag for revision.
90fc62d6693e Find most recent tag for revision.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1032
diff changeset
   497
==================================
90fc62d6693e Find most recent tag for revision.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1032
diff changeset
   498
::
90fc62d6693e Find most recent tag for revision.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1032
diff changeset
   499
90fc62d6693e Find most recent tag for revision.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1032
diff changeset
   500
  $ hg log -r "sort(tag() and ancestors($REV),-date)"
90fc62d6693e Find most recent tag for revision.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1032
diff changeset
   501
  $ hg log -r $REV --template "{latesttag}-{latesttagdistance}-{node|short}\n"
90fc62d6693e Find most recent tag for revision.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1032
diff changeset
   502
1001
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   503
Hooks.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   504
======
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   505
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   506
Check for bad branch names.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   507
---------------------------
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   508
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   509
.hg/hgcheck.py::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   510
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   511
  import re
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   512
  goodbranch_re = r'((bug|feature)#\d|release-1\.\d\.\d|default)$'
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   513
  def precommit_badbranchname(ui, repo, hooktype, **kwargs):
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   514
      ui.warn('"%s" hook failed\n' % hooktype)
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   515
      for rev in repo:
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   516
          branch = repo[rev].branch()
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   517
          re_ = re.compile(goodbranch_re)
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   518
          if not re_.match(branch):
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   519
              ui.warn('Invalid branch name "%s".\nUse one of default, bug#ID, feature#ID or release-1.XX.XX.\n' % branch)
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   520
              return True
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   521
      return False
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   522
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   523
.hg/hgrc::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   524
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   525
  [hooks]
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   526
  precommit.badbranchname = python:.hg/hgcheck.py:precommit_badbranchname
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   527
  # precommit.gg = python:my.hgcheck.py.precommit_badbranch
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   528
  prechangegroup.badbranchname = python:.hg/hgcheck.py:precommit_badbranchname
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   529
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   530
Read more:
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   531
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   532
  http://mercurial.selenic.com/wiki/HookExamples
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   533
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   534
Ignore patterns.
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   535
----------------
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   536
::
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   537
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   538
  $ cat $proj/.hgignore
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   539
  syntax: glob
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   540
  *.o
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   541
  .obj
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   542
  *.exe
4dd76ea12a6d Downgrade repository format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   543
1646
fdd6045a5563 Reorder sections.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1645
diff changeset
   544
Free Mercurial hosting.
fdd6045a5563 Reorder sections.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1645
diff changeset
   545
=======================
fdd6045a5563 Reorder sections.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1645
diff changeset
   546
fdd6045a5563 Reorder sections.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1645
diff changeset
   547
  http://mercurial.selenic.com/wiki/MercurialHosting
fdd6045a5563 Reorder sections.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1645
diff changeset
   548
                Free Hosting of Mercurial Repositories
fdd6045a5563 Reorder sections.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1645
diff changeset
   549