1. removed files were missed
2. hidden files in top directory were not added/removed correctly
3. suppressed spurious warning on adding new files.
4. hg changeset now checked in with original author and date
5. __file__ not supported by pdb.py
The plugin takes an 'hg export'ed patch (in fact any
single or multi file patch) and opens multiple tabs
containing vim diff/merge windows for each affected
file in the patch allowing full visual code reviews.
For revision range limitation,
use "-r" opt with range notation at "hg log" invocation, and
use hg-rev-completion-limit as default value.
For shown changesets limitation,
use "-l" opt at "hg log" invocation, and
use hg-log-limit as default value.
Right now we always call "hg help $cmd" to get the canonical name of $cmd
(i.e. to go from "co" to "update").
This patch optimistically assumes that $cmd is already the canonical form
and tries to generate completions for it. If that fails, it falls back
to canonicalizing $cmd and trying again.
This means that:
- if a command or alias is explicitly handled by the
_hg_command_specific function, things get somewhat faster
- as long as the canonical $cmd is handled by _hg_command_specific, all
its aliases and abbreviations are also handled.
I've been having an hgk problem with this tree:
http://xenbits.xensource.com/ext/linux-ppc-2.6.hg, specifically changeset
93c590d23a53.
The problem seems to be that the commit message contains a "committer:" line,
which triggers a (relatively unused?) case in hgk.py... Both cases need the
dates at the end of the line.
add a new command debugcomplete, it lists all the possible
completion for the specified command.
make the bash_completion script uses it instead of the awk code
TK Soh noticed that the awk that ships with Solaris doesn't allow you
to define new functions. According to
http://www.shelldorado.com/articles/awkcompat.html
it looks like it also doesn't have some other stuff that we were using,
like deletion of an array element and gsub.
Rewrite the parsing of hg --debug help to work around that. This
version doesn't filter aliases that are simple abbreviations for debug
commands (not a big problem, since there are none right now).
- use awk to parse the output of hg help.
- print one completion candidate per line
- print the debug commands after regular commands
(this eases the shell side of the parsing)
- don't print aliases that are simple abbreviations
(e.g. up/update, id/identify)
- Use "hg status -n" option instead of cut command.
- Sort status flags accoring to "hg status --help"
- Show deleted files instead of "hg remove"d for "hg remove"
hg status will now show "R filename" for "hg rm"ed files and
"! filename" for files which were deleted manually.
Manually deleted files are considered unmodified.
The current bash completion script is quite painful in conjuntion with
deep directory trees because it adds a space after each successful
directory completion. Eg. "hg clone /ho<tab>" is completed to "hg clone
/home " when what you really want is "hg clone /home/" (assuming the
complete path to the repository looks like /home/foo/hg...).
That's because the 'complete' command does not know about the type of
completion it receives from the _hg shell function. When only a single
completion is returned, it assumes completion is complete and tells
readline to add a trailing space. This behaviour is usually wanted, but
not in the case of directory completion.
I've attached a patch that circumvents this problem by only returning
successful completions for directories that contain a .hg subdirectory.
If no repositories are found, no completions are returned either, and
bash falls back to ordinary (filename) completion. I find this behaviour
a lot less annoying than the current one.
Alternative: Use option nospace for the 'complete' command and let _hg
itself take care of adding a trailing space where appropriate. That's a
far more intrusive change, though.
To be used in ~/.ssh/authorized_keys with the "command" option, see sshd(8):
command="hg-ssh path/to/repo1 /path/to/repo2 ~/repo3 ~user/repo4" ssh-dss ...
(probably together with these other useful options:
no-port-forwarding,no-X11-forwarding,no-agent-forwarding)
This allows pull/push over ssh to to the repositories given as arguments.
If all your repositories are subdirectories of a common directory, you can
allow shorter paths with:
command="cd path/to/my/repositories && hg-ssh repo1 subdir/repo2"
File completers now correctly deal with filenames that contain spaces.
The completers also use 'hg status .' so they'll work correctly when the
default behaviour changes.
it works almost the same as git-bisect:
hg bisect init # start bisecting
hg bisect bad # mark current revision as broken
hg bisect good [<rev>] # mark <rev> as working
... the bisect code finds a new revision to try
... see if it works
hg bisect good # if it worked
hg bisect bad # it doesn't work
continue until there is only one revision left
With GNU Emacs 21.4.1 and desktop save/restore enabled, loading
"mercurial.el" from ".emacs" breaks Emacs' initialization sequence
when the desktop restore code loads a file under Mercurial control.
The function 'desktop-create-buffer' passes an argument to each
minor mode it activates for the buffer.
--- mercurial-0.7.orig/contrib/hgk 2005-09-23 11:02:21.000000000 +0200
+++ mercurial-0.7/contrib/hgk 2005-09-23 11:07:57.000000000 +0200
@@ -1,6 +1,4 @@
-#!/bin/sh
-# Tcl ignores the next line -*- tcl -*- \
-exec wish "$0" -- "${1+$@}"
+#!/usr/bin/wish
# Copyright (C) 2005 Paul Mackerras. All rights reserved.
# This program is free software; it may be used, copied, modified
contrib/convert-repo changes:
- do not print verbose output so that error messages are seen more easily
- Output the date as integer and not as floating point number.
- Do not require a ".git" subdirectory to work on, but use the GIT_DIR
environment var to specify the git repository.
Change is otherwise compatible to the current version and I have tested it
by converting the kernel and several git respositories from kernel.org.
(Btw, the udev test dir contains a /sys dir with entries which should not
be normal dirs and not be normal files. ;-)
Thanks again for mercurial,
Florian La Roche
--- a/contrib/convert-repo
+++ b/contrib/convert-repo
@@ -28,26 +28,18 @@
self.path = path
def getheads(self):
- h = file(self.path + "/.git/HEAD").read()[:-1]
- return [h]
+ return [file(self.path + "/HEAD").read()[:-1]]
def catfile(self, rev, type):
if rev == "0" * 40: raise IOError()
- path = os.getcwd()
- os.chdir(self.path)
- fh = os.popen("git-cat-file %s %s 2>/dev/null" % (type, rev))
- os.chdir(path)
+ fh = os.popen("GIT_DIR=%s git-cat-file %s %s 2>/dev/null" % (self.path, type, rev))
return fh.read()
def getfile(self, name, rev):
return self.catfile(rev, "blob")
def getchanges(self, version):
- path = os.getcwd()
- os.chdir(self.path)
- fh = os.popen("git-diff-tree --root -m -r %s" % (version))
- os.chdir(path)
-
+ fh = os.popen("GIT_DIR=%s git-diff-tree --root -m -r %s" % (self.path, version))
changes = []
for l in fh:
if "\t" not in l: continue
@@ -83,9 +75,9 @@
def gettags(self):
tags = {}
- for f in os.listdir(self.path + "/.git/refs/tags"):
+ for f in os.listdir(self.path + "/refs/tags"):
try:
- h = file(self.path + "/.git/refs/tags/" + f).read().strip()
+ h = file(self.path + "/refs/tags/" + f).read().strip()
tags[f] = h
except:
pass
@@ -99,8 +91,7 @@
def getheads(self):
h = self.repo.changelog.heads()
- h = [ hg.hex(x) for x in h ]
- return h
+ return [ hg.hex(x) for x in h ]
def putfile(self, f, e, data):
self.repo.wfile(f, "w").write(data)
@@ -155,12 +146,12 @@
newlines.sort()
if newlines != oldlines:
- print "updating tags"
+ #print "updating tags"
f = self.repo.wfile(".hgtags", "w")
f.write("".join(newlines))
f.close()
if not oldlines: self.repo.add([".hgtags"])
- date = "%s 0" % time.mktime(time.gmtime())
+ date = "%s 0" % int(time.mktime(time.gmtime()))
self.repo.rawcommit([".hgtags"], "update tags", "convert-repo",
date, self.repo.changelog.tip(), hg.nullid)
@@ -262,7 +253,7 @@
num -= 1
if c in self.map: continue
desc = self.commitcache[c][3].splitlines()[0]
- print num, desc
+ #print num, desc
self.copy(c)
tags = self.source.gettags()
@@ -275,6 +266,8 @@
self.dest.puttags(ctags)
gitpath, hgpath, mapfile = sys.argv[1:]
+if os.path.isdir(gitpath + "/.git"):
+ gitpath += "/.git"
c = convert(convert_git(gitpath), convert_mercurial(hgpath), mapfile)
c.convert()
_______________________________________________
Mercurial mailing list
Mercurial@selenic.comhttp://selenic.com/mailman/listinfo/mercurial
Move hgit to hgk.py
- importing hgit as an extension created compiled hgitc, which was confusing
- hgit existed to support hgk so it was slightly misnamed
- removed executable bit as we no longer run it directly
- add 'view' command so we can run hg view
- change git-* commands to debug-* so hg help won't show them
- chdir to repository root on view so hgk doesn't choke in subdirs
--- crew.orig/contrib/convert-repo 2005-07-16 11:52:06.000000000 -0400
+++ crew/contrib/convert-repo 2005-09-02 02:58:14.000000000 -0400
@@ -86,9 +86,7 @@ class convert_git:
for f in os.listdir(self.path + "/.git/refs/tags"):
try:
h = file(self.path + "/.git/refs/tags/" + f).read().strip()
- p, a, d, m = self.getcommit(h)
- if not p: p = [h] # git is ugly, don't blame me
- tags[f] = p[0]
+ tags[f] = h
except:
pass
return tags
--
_______________________________________________
Mercurial mailing list
Mercurial@selenic.comhttp://selenic.com/mailman/listinfo/mercurial
Most SCM commands now work in derived buffers (e.g. diff viewing
buffers) as well as buffers backed by files.
diff and log now work properly on repositories and files.
Commit support is more solid.
Doc strings are better.
Use hg status to determine which files are interesting for various commands.
Thus, hg add [tab] finds unknown files, and hg commit [tab] finds added, modified, or removed files.
Contributed by "Alexis S. L. Carvalho" <alexis@cecm.usp.br>
Attached is a file that implements bash completion for hg. Just
reading it from your .bashrc should be enough to use it - I think: I'm
using the /etc/bash_completion from debian and I'm not sure whether it
sets some important option.
It gets the list of commands, aliases and options from the output of hg
help and then adds some specific stuff - e.g. completing update with
tags; pull and push with path aliases and directories, etc.
Git tags are bad, very bad. More importantly, they're horribly
inconsistent. This drops tags which don't appear to work like most of
the others.
manifest hash: f2dda9e9a3ae8a0d84b19e496059b8a795b8e603
call out to git-cat-file directly to deal with packed files
use git-diff-tree --root to handle import of first commit
quiet some dirstate warnings
fix parent logic in commit
whitespace bits
topological sort fix
manifest hash: 2943af0168dd2f5e85bba6515fd08687e264863f
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
[PATCH] Add contrib/buildrpm script
From: Bryan O'Sullivan <bos@serpentine.com>
Just run "buildrpm", and it builds an RPM for you. No funky monkey
business required.
manifest hash: b8fde5108b5cc8f49ce248d14ac2ee7ad004c91c
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCxb6sywK+sNU5EO8RApQZAJ94VD6NQr9l4Xx6w3S8EdpCIUuiIACfdoHA
qnQWtMM+kqAzi3LnO92UYWE=
=SWIO
-----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
[PATCH] clean up RPM spec file
From: Bryan O'Sullivan <bos@serpentine.com>
The current RPM spec file makes it impossible to split Mercurial into
multiple interdependent packages. Here's a patch that fixes that
problem.
manifest hash: 4acc4c5cf4485d92a32d2259b83314b7167dece3
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCxb2+ywK+sNU5EO8RAnrTAJ4tkAh6xnHvRHMxzrfqKb/SXYS2wwCeMfK1
PAr+1FFoSqUmA9rt8Yaw6f4=
=MaPn
-----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
convert-repo fixups
- - deal with octopus merge
uniqueify parent list
add a series of identical commits with "(octopus merge fixup)"
- - add "committer" field from git to the commit message
manifest hash: e33d802afe35edecfc5cc9b567def6db2b0cb885
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCubogywK+sNU5EO8RAkWgAJ9OVHeumKd/nRIfvS/nQ9eSbORqNgCgpBIE
Dza0L59OSJHHmm3Dbp7ygds=
=OEvJ
-----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
[PATCH] Using monotone-viz/git-viz with mercurial
From: Vincent Danjean <vdanjean.ml@free.fr>
monotone-viz is a small GTK+ application that visualizes monotone
ancestry graphs. Its home page is:
http://oandrieu.nerim.net/monotone-viz/
As monotone and git are similar, the author adapted the 0.9 version to
display git ancestry graphs and call it git-viz. I cannot see any link
from the homepage, but looking in the archive of git ML, it can be found
here:
http://oandrieu.nerim.net/monotone-viz/git-viz-0.1.tar.gz
I few days ago, I adapted it so that it works with the last versions
of git/cogito. Patches and package are available here:
http://dept-info.labri.fr/~danjean/deb.html#git-viz
Today, I patched hgit so that it respects the output of git-diff-tree,
I added git-{diff-tree,cat-file,rev-list,rev-tree} that call hgit (2
lines scripts), and added the script 'hg-viz'.
hg-viz create a .git directory and store the SHA1 of the tip in
.git/HEAD and then call my git-viz.
All these modifications are in the attached patch.
I try it in the mercurial repository. After applying the patch, you
just have to add the contrib directory in your PATH and call hg-viz.
An example of what we can see is on my web page (probably not for a
long time) : http://dept-info.labri.fr/~danjean/temp/hg-viz.png
Vincent
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCuM50ywK+sNU5EO8RAtlvAJ425JJI9chCdSi8D+R2Af/vJEOUpACffC9e
fxjJ3umBkffj5g86jWaRGZ0=
=LwA2
-----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Show revisions in diffs like CVS, based on a patch from Goffredo Baroncelli.
Changes from the original patch:
- - Use 'diff -r ...' instead of 'hg diff -r ...' to support filetype detection
by at least file(1) and vim.
- - Adjusted tests for this change.
- - Some cleanups.
manifest hash: 5f37d1ef75ea7f4e48b53f02371053ba54fb70f8
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFCsyZzW7P1GVgWeRoRAqczAJ479lR9Z289sP+VH5L+N7pQRU14SACfUueq
88ABloIR3VyRIa4qbujnZio=
=Vva9
-----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
hgit rev-list support
From: Chris Mason <mason@suse.com>
Update hgit rev-list support, make it a special case of hgit rev-tree
Print newest commit first
Add the ability to specify the max number of commits to print (-n or --max-nr=)
Match git feature of stopping at a given commit (hgit rev-list start_commit sto\p_commit)
manifest hash: b9bbd5e95dae771ebef89f8f4102e458052b1835
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCsG26ywK+sNU5EO8RAm5OAJ46G1nhXN2kQ+cKaBOK+oX4zSdQRgCdECvG
6wbG0JRdm7S29K4ynzs4cyY=
=pwpz
-----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Add new convert-repo script
This is the beginnings of a generalized framework for converting
repositories. Currently hardwired to convert from git to hg.
manifest hash: dc3b72de2c45bfdaffcc1cf71da530228793facd
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCrGf/ywK+sNU5EO8RAi9EAJ0eQ++cwSgn5j2PHiTvF7r3JNiv4gCePY+X
do12pUvCczyBKVCoBN7y/uI=
=YtzI
-----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
minor hgk fixes
From: Chris Mason <mason@suse.com>
hgk was missing the last commit when reading the output from hgit rev-list -c
Some how a debugging puts snuck into the hgk I sent out. Remove it:
manifest hash: cc0ec1d46fbbe9b7e9bf6404f9dbe2ec787811ba
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCp13mywK+sNU5EO8RAnkqAJ49W/i1mwt38Yws4t0mEQeKttsOSQCgi9fS
/t42Uy0Qj9yeVppGPLel/bI=
=eIrI
-----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
[PATCH] hgk should parse dates in the diff output
hgk doesn't deal well with the difflib style diffs, it expects the filename
to be the last thing on the line. This patch fixes the regexp to stop
reading the filename at the first tab.
Signed-off-by: Chris Mason <mason@suse.com>
manifest hash: 9c5bcf427455dcf306ab6f91b1986723caa83f36
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCpl/HywK+sNU5EO8RAgAjAKCOuZsRtJDbdurTQry+7krtLTtRQQCfXLuN
LZEFkcOGS0jiAC6vci/RLJ0=
=jkr1
-----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Initial import of hgit and hgk
Support for git compatibility sufficient to run gitk on top of hg
repositories. This includes:
hgit diff-tree
hgit rev-list
hgit rev-tree
hgit cat-file
Signed-off-by: Chris Mason <mason@suse.com>
hgk is a slightly modified version of gitk1.1 from Paul Mackerras. It has
been changed to use hgit commands, and has support for the extended
rev-list -c to speed up the commit listing.
Signed-off-by: Chris Mason <mason@suse.com>
manifest hash: 5a4a27135bc85bab2a3a1e35018a08a985d8d146
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCpVQ4ywK+sNU5EO8RAl3QAJ9p6VyZ8fCHfgt0p8ksgL2P215DXQCfZU47
d+u5GpZvkOTOc3+LU3Ny3nE=
=rjsC
-----END PGP SIGNATURE-----