hg-paste /

Filename Size Date modified Message
29 B
2.5 KB
5.7 KB
-*- markdown -*-

hg-paste
========

hg-paste adds an `hg paste` command to Mercurial which can send diffs to
various pastebin websites for easy sharing.

It was inspired by [Pocoo][]'s [hgpaste][pocoopaste] extension, but is designed
to work with public and private pastebin websites instead of only private
installations of [LodgeIt][].

[Pocoo]: http://www.pocoo.org/
[pocoopaste]: http://dev.pocoo.org/hg/hgpaste/
[LodgeIt]: http://dev.pocoo.org/projects/lodgeit/

Installing
----------

Clone the repository:

    hg clone http://bitbucket.org/sjl/hg-paste/

Edit the `[extensions]` section in your `~/.hgrc` file:

    [extensions]
    paste = (path to)/hg-paste/paste.py

Using the Command
-----------------

To paste a diff of all uncommitted changes in the working directory:

    hg paste

To paste the changes that revision `REV` made:

    hg paste -r REV

To paste the changes between revisions `REV1` and `REV2`:

    hg paste -r REV1:REV2

If any files are specified only those files will be included in the diffs.

Several options can be used to specify more metadata about the paste:

    hg paste --user Steve --title 'Progress on feature X' --keep

The pastebin website to use can be specified with `--dest`.

Currently supported pastebins:

- [dpaste.com](http://dpaste.com/)
- [dpaste.org](http://dpaste.org)
- [pastebin.dixo.net](http://pastebin.dixo.net) (old pastebin.com by Paul Dixon)
- [paste.pocoo.org](http://paste.pocoo.org)
- Probably any [LodgeIt](http://dev.pocoo.org/projects/lodgeit/) based pastebin
- Probably any [django-paste](http://github.com/bartTC/django-paste) based pastebin

Hints and tips
--------------

Change the default pastebin

    [defaults]
    paste = --dest dpaste.org

Paste the last applied patch on the queue

    hg paste -r qtip

And its handy alias:

    [alias]
    qpaste = paste -r qtip

Alias to paste to an intranet pastebin

    [alias]
    ipaste = paste --dest dpaste.org --url https://paste.intranet.com --httpauth user:pass

Or use [~/.netrc](http://linux.die.net/man/5/netrc) if you don't like plain
plasswords in your ~/.hgrc

    [alias]
    ipaste = paste --dest dpaste.org --url https://paste.intranet.com --usenetrc

Questions, Comments, Suggestions
--------------------------------

If you find any bugs, please create an issue in the [issue tracker][issues].

If you want to contribute (support for more pastebin websites would be great),
fork the [repository][] on BitBucket and send a pull request.

[issues]: http://bitbucket.org/sjl/hg-paste/issues/?status=new&status=open
[repository]: http://bitbucket.org/sjl/hg-paste
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.