contrib/sample.hgrc
author A. S. Budden <abudden@gmail.com>
Fri, 30 Mar 2012 22:08:46 +0100
changeset 16324 46b991a1f428
parent 11269 5f01fd602542
child 20143 216d3d85372b
permissions -rw-r--r--
record: allow splitting of hunks by manually editing patches It is possible that unrelated changes in a file are on sequential lines. The current record extension does not allow these to be committed independently. An example use case for this is in software development for deeply embedded real-time systems. In these environments, it is not always possible to use a debugger (due to time-constraints) and hence inline UART-based printing is often used. When fixing a bug in a module, it is often convenient to add a large number of 'printf's (linked to the UART via a custom fputc) to the module in order to work out what is going wrong. printf is a very slow function (and also variadic so somewhat frowned upon by the MISRA standard) and hence it is highly undesirable to commit these lines to the repository. If only a partial fix is implemented, however, it is desirable to commit the fix without deleting all of the printf lines. This is also simplifies removal of the printf lines as once the final fix is committed, 'hg revert' does the rest. It is likely that the printf lines will be very near the actual fix, so being able to split the hunk is very useful in this case. There were two alternatives I considered for the user interface. One was to manually edit the patch, the other to allow a hunk to be split into individual lines for consideration. The latter option would require a significant refactor of the record module and is less flexible. While the former is potentially more complicated to use, this is a feature that is likely to only be used in certain exceptional cases (such as the use case proposed above) and hence I felt that the complexity would not be a considerable issue. I've also written a follow-up patch that refactors the 'prompt' code to base everything on the choices variable. This tidies up and clarifies the code a bit (removes constructs like 'if ret == 7' and removes the 'e' option from the file scope options as it's not relevant there. It's not really a necessity, so I've excluded it from this submission for now, but I can send it separately if there's a desire and it's on bitbucket (see below) in the meantime. Possible future improvements include: * Tidying up the 'prompt' code to base everything on the choices variable. This would allow entries to be removed from the prompt as currently 'e' is offered even for entire file patches, which is currently unsupported. * Allowing the entire file (or even multi-file) patch to be edited manually: this would require quite a large refactor without much benefit, so I decided to exclude it from the initial submission. * Allow the option to retry if a patch fails to apply (this is what Git does). This would require quite a bit of refactoring given the current 'hg record' implementation, so it's debatable whether it's worth it. Output is similar to existing record user interface except that an additional option ('e') exists to allow manual editing of the patch. This opens the user's configured editor with the patch. A comment is added to the bottom of the patch explaining what to do (based on Git's one). A large proportion of the changeset is test-case changes to update the options reported by record (Ynesfdaq? instead of Ynsfdaq?). Functional changes are in record.py and there are some new test cases in test-record.t.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2615
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
     1
### --- User interface
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
     2
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
     3
[ui]
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
     4
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
     5
### show changed files and be a bit more verbose if True
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
     6
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
     7
# verbose = True
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
     8
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
     9
### username data to appear in comits
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    10
### it usually takes the form: Joe User <joe.user@host.com>
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    11
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    12
# username = Joe User <j.user@example.com>
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    13
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    14
### --- Extensions
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    15
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    16
[extensions]
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    17
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    18
### each extension has its own 'extension_name=path' line
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    19
### the default python library path is used when path is left blank
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    20
### the hgext dir is used when 'hgext.extension_name=' is written
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    21
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    22
### acl - Access control lists
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    23
### hg help acl
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    24
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    25
# hgext.acl =
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    26
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    27
### bisect - binary search changesets to detect bugs
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    28
### hg help bisect
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    29
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    30
# hgext.hbisect =
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    31
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    32
### bugzilla - update bugzilla bugs when changesets mention them
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    33
### hg help bugzilla
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    34
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    35
# hgext.bugzilla =
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    36
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    37
### extdiff - Use external diff application instead of builtin one
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    38
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    39
# hgext.extdiff =
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    40
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    41
### gpg - GPG checks and signing
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    42
### hg help gpg
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    43
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    44
# hgext.gpg =
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    45
4344
345ed833854d Add graphlog extension
Joel Rosdahl <joel@rosdahl.net>
parents: 3944
diff changeset
    46
### graphlog - ASCII graph log
345ed833854d Add graphlog extension
Joel Rosdahl <joel@rosdahl.net>
parents: 3944
diff changeset
    47
### hg help glog
345ed833854d Add graphlog extension
Joel Rosdahl <joel@rosdahl.net>
parents: 3944
diff changeset
    48
345ed833854d Add graphlog extension
Joel Rosdahl <joel@rosdahl.net>
parents: 3944
diff changeset
    49
# hgext.graphlog =
345ed833854d Add graphlog extension
Joel Rosdahl <joel@rosdahl.net>
parents: 3944
diff changeset
    50
2615
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    51
### hgk - GUI repository browser
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    52
### hg help view
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    53
3944
20f1c8440c53 sample.hgrc: hgk extension is now in hgext. Use churn as example for contrib.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2615
diff changeset
    54
# hgext.hgk =
2615
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    55
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    56
### mq - Mercurial patch queues
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    57
### hg help mq
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    58
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    59
# hgext.mq =
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    60
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    61
### notify - Template driven e-mail notifications
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    62
### hg help notify
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    63
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    64
# hgext.notify =
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    65
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    66
### patchbomb - send changesets as a series of patch emails
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    67
### hg help email
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    68
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    69
# hgext.patchbomb =
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    70
3944
20f1c8440c53 sample.hgrc: hgk extension is now in hgext. Use churn as example for contrib.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2615
diff changeset
    71
### churn - create a graph showing who changed the most lines
20f1c8440c53 sample.hgrc: hgk extension is now in hgext. Use churn as example for contrib.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2615
diff changeset
    72
### hg help churn
20f1c8440c53 sample.hgrc: hgk extension is now in hgext. Use churn as example for contrib.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2615
diff changeset
    73
20f1c8440c53 sample.hgrc: hgk extension is now in hgext. Use churn as example for contrib.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2615
diff changeset
    74
# hgext.churn = /home/user/hg/hg/contrib/churn.py
20f1c8440c53 sample.hgrc: hgk extension is now in hgext. Use churn as example for contrib.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2615
diff changeset
    75
11269
5f01fd602542 win32text: mark this extension as deprecated
Martin Geisler <mg@aragost.com>
parents: 4344
diff changeset
    76
### eol - automatic management of line endings
2615
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    77
11269
5f01fd602542 win32text: mark this extension as deprecated
Martin Geisler <mg@aragost.com>
parents: 4344
diff changeset
    78
# hgext.eol =
2615
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    79
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    80
### --- hgk additional configuration
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    81
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    82
[hgk]
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    83
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    84
### set executable path
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    85
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    86
# path = /home/user/hg/hg/contrib/hgk
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    87
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    88
### --- Hook to Mercurial actions - See hgrc man page for avaliable hooks
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    89
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    90
[hooks]
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    91
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    92
### Example notify hooks (load hgext.notify extension before use)
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    93
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    94
# incoming.notify = python:hgext.notify.hook
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    95
# changegroup.notify = python:hgext.notify.hook
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    96
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    97
### Email configuration for the notify and patchbomb extensions
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    98
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
    99
[email]
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   100
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   101
### Your email address
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   102
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   103
# from = user@example.com
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   104
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   105
### Method to send email - smtp or /usr/sbin/sendmail or other program name
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   106
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   107
# method = smtp
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   108
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   109
### smtp server to send email to
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   110
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   111
[smtp]
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   112
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   113
# host = mail
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   114
# port = 25
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   115
# tls = false
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   116
# username = user
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   117
# password = blivet
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   118
# local_hostname = myhost
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   119
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   120
### --- Email notification hook for server
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   121
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   122
[notify]
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   123
### multiple sources can be specified as a whitespace or comma separated list
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   124
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   125
# sources = serve push pull bundle
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   126
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   127
### set this to False when you're ready for mail to start sending
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   128
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   129
# test = True
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   130
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   131
### path to config file with names of subscribers
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   132
b075216da118 contrib: add sample.hgrc
Rafael Villar Burke <pachi@mmn-arquitectos.com>
parents:
diff changeset
   133
# config = /path/to/subscription/file