|
Blog entriesHere is at last the release of the version 1.2.0 of hgview.
In a nutshell, this release includes:
- a basic support for mq extension,
- a basic support for hg-bfiles extension,
- working directory is now displayed as a node of the graph (if there are local modifications of course),
- it's now possible to display only the subtree from a given revision (a bit like hg log -f)
- it's also possible to activate an annotate view (make navigation slower however),
- several improvements in the graph filling and rendering mecanisms,
- I also added toolbar icons for the search and goto "quickbars" so they are not "hidden" any more to the one reluctant to user manuals,
- it's now possible to go directly to the common ancestor of 2 revisions,
- when on a merge node, it's now possible to choose the parent the diff is computed against,
- make search also search in commit messages (it used to search only in diff contents),
- and several bugfixes of course.
- Notes:
- there are packages for debian lenny, squeeze and sid, and for ubuntu hardy, interpid, jaunty and karmic. However, for lenny and hardy, provided packages won't work on pure distribs since hgview 1.2 depends on mercurial 1.1. Thus for these 2 distributions, packages will only work if you have installed backported mercurial packages.
An interesting question has just been sent by Greg Ward on the
Mercurial devel mailing-list (as a funny coincidence, it happened
that I had to solve this problem a few days ago).
Let me quote his message:
here's my problem: imagine a customer is running software built from
changeset A, and we want to upgrade them to a new version, built from
changeset B. So I need to know what bugs are fixed in B that were not
fixed in A. I have already implemented a changeset/bug mapping, so I
can trivially lookup the bugs fixed by any changeset. (It even handles
"ongoing" and "reverted" bugs in addition to "fixed".)
And he gives an example of situation where a tricky case may be found:
+--- 75 -- 78 -- 79 ------------+
/ \
/ +-- 77 -- 80 ---------- 84 -- 85
/ / /
0 -- ... -- 74 -- 76 /
\ /
+-- 81 -- 82 -- 83 --+
Imagine the lastest distributed stable release is built on rev 81. Now,
I need to publish a new bugfix release based on this latest stable
version, including every changeset that is a bugfix, but that have not
yet been applied at revision 81.
So the first problem we need to solve is answering: what are the
revisions ancestors of revision 85 that are not ancestor of revision
81?
Using hg commands, the solution is proposed by Steve Losh:
hg log --template '{rev}\n' --rev 85:0 --follow --prune 81
or better, as suggested by Matt:
hg log -q --template '{rev}\n' --rev 85:0 --follow --prune 81
The second is better since it does only read the index, and thus is
much faster. But on big repositories, this command remains quite slow
(with Greg's situation, a repo of more than 100000 revisions, the
command takes more than 2 minutes).
Using Python, one may think about using revlog.nodesbetween(), but it
won't work as wanted here, not listing revisions 75, 78 and 79.
On the mailing list, Matt gave the most simple and efficient solution:
cl = repo.changelog
a = set(cl.ancestors(81))
b = set(cl.ancestors(85))
revs = b - a
Using this simple python code, it should be easy to write a nice Mercurial extension (which could be named missingrevisions) to do this job.
Then, it should be interesting to also implement some filtering
feature. For example, if there are simple conventions used in commit
messages, eg. using something like "[fix #1245]" or "[close
#1245]" in the commit message when the changeset is a fix for a bug
listed in the bugtracker, then we may type commands like:
hg missingrevs REV -f bugfix
or:
hg missingrevs REV -h HEADREV -f bugfix
to find bugfix revisions ancestors of HEADREV that are not ancestors
of REV.
With filters (bugfix here) may be configurables in hgrc using regexps.
I am pleased to announce the latest release of hgview 1.1.0.
For the ones from the back of the classroom near the radiator, let me
remind you that hgview is a very helpful tool for daily work using
the excellent DVCS Mercurial (which we heavily use at Logilab). It
allows to easily and visually navigate your hg repository revision
graphlog. It is written in Python and pyqt.
- user can now configure colors used in the diff area (and they now
defaults to white on black)
- indicate current working directory position by a square node
- add many other configuration options (listed when typing hg help hgview)
- removed 'hg hgview-options' command in favor of 'hg help hgview'
- add ability to choose which parent to diff with for merge nodes
- dramatically improved UI behaviour (shortcuts)
- improved help and make it accessible from the GUI
- make it possible not to display the diffstat column of the file list
(which can dramatically improve performances on big repositories)
- standalone application: improved command line options
- indicate working directory position in the graph
- add auto-reload feature (when the repo is modified due to a pull, a
commit, etc., hgview detects it, reloads the repo and updates the
graph)
- fix many bugs, especially the file log navigator should now
display the whole graph
The source code is available as a tarball, or using our public hg repository of course.
To use it from the sources, you just have to add a line in your .hgrc file, in the [extensions] section:
hgext.hgview=/path/to/hgview/hgext/hgview.py
Debian and Ubuntu users can also easily install hgview (and Logilab other free software tools) using our deb package repositories.
I am pleased to introduce you to the latest kid of the Logilab team: hgview 1.0.0.
hgview is a very helpful tool for daily work using the excellent DVCS Mercurial (which we heavily use at Logilab). It allows to easily and visually navigate your hg repository revision graphlog. It is written in Python and pyqt.
This version is an almost complete rewrite of hgview 0.x which had two GUI backends, gtk and qt4. This 1.0 release drops the gtk backend (we may consider reintroducing it, we haven't decided yet... by the way, patches are always welcome). Some may not like this choice, but the immediate benefit of using qt4 is that hgview works like a charm on MacOS X systems.
Edit: there was a bug in hgview 1.0.0 on Ubuntu hardy. It's now fixed, and I've uploaded a 1.0.1 version deb package for hardy.
- 4 different viewers:
- repository navigator that displays the graphlog efficiently (works well with 10,000 changesets),
- filelog navigator that displays the filelog of a file (follows files through renames),
- filelog diff navigator that displays the filelog in diff mode to easily track changes between two revisions of a file,
- manifest viewer that navigates in the files hierarchy as it was at a given revision.
- Each viewer offers:
- easy keyboard navigation:
- up/down to change revision,
- left/right to change file (for the repo navigator only),
- return to display the diff viewer of the selected file,
- search quickbar (Ctrl+F or /): search in graphlog (search as you type in the currently displayed file or diff, plus a cancellable background search in the revision tree),
- goto quickbar (Ctrl+G): go to the given revision (accepts id or tag, with completion for tags),
- navigation history: alt+left/alt+right to navigate backward/forward in the history,
- can be used alone or as a hg extension,
- can be configured using standard hg rc files (system, user or per repository),
- possibility to declare users (with multiple mail addresses) and assign them a given color to make a given user look the same in all your repositories,
The source code is available as a tarball, or using our public hg repository of course.
To use it from the sources, you just have to add a line in your .hgrc file, in the [extensions] section:
hgext.hgview=/path/to/hgview/hgext/hgview.py
Debian and Ubuntu users can also easily install hgview (and Logilab other free software tools) using our deb package repositories.
My latest personal project, pygpibtoolkit, holds a simple HPGL plotter trying to emulate the HP7470A GPIB plotter, using the very nice and cheap Prologix USB-GPIB dongle.
This tool is (for now) called qgpibplotter (since it is using the Qt4 toolkit).
Tonight, I took (at last) the time to make it work nicely. Well, nicely with the only device I own which is capable of plotting on the GPIB bus, my HP3562A DSA.
Now, you just have to press the "Plot" button of your test equipment, and bingo! you can see the plot on your computer.
I have a laptop I use at work (with a docking station), in the train and at home (with an external display), on which my environment is ion3.
As I use suspend-to-RAM all the time, I have added some keybindings to automatically reconfigure my screen when I plug/unplug an external display (on the dock as well as direct VGA connection).
The lua code to paste in your .ion3/cfg_ion.lua for the bindings looks like:
function autoscreen_on()
local f = io.popen('/home/david/bin/autoscreen -c', 'r')
if not f then
return
end
local s = f:read('*a')
f:close()
ioncore.restart()
end
function autoscreen_off()
local f = io.popen('/home/david/bin/autoscreen -d', 'r')
if not f then
return
end
local s = f:read('*a')
f:close()
ioncore.restart()
end
defbindings("WMPlex.toplevel", {
bdoc("Turn on any external display and tell ion to reconfigure itself"),
kpress(META.."F10",
"autoscreen_on()"),
})
defbindings("WMPlex.toplevel", {
bdoc("Turn off any external display and tell ion to reconfigure itself"),
kpress(META.."F11",
"autoscreen_off()"),
})
It makes use of the following python script (named /home/david/bin/autoscreen in the lua code above):
#!/usr/bin/env python
import sys
import os
import re
from subprocess import Popen, PIPE
import optparse
parser = optparse.OptionParser("A simple automatic screen configurator (using xrandr)")
parser.add_option('-c', '--connect', action="store_true",
dest='connect',
default=False,
help="configure every connected screens")
parser.add_option('-d', '--disconnect', action="store_true",
dest='disconnect',
default=False,
help="unconfigure every connected screens other than LVDS (laptop screen)")
parser.add_option('', '--main-display',
dest='maindisplay',
default="LVDS",
help="main display identifier (typically, the laptop LCD screen; defaults to LVDS)")
options, args = parser.parse_args()
if int(options.connect) + int(options.disconnect) > 1:
print "ERROR: only one option -c or -d at a time"
parser.print_help()
sys.exit(1)
xrandr = Popen("xrandr", shell=True, bufsize=0, stdout=PIPE).stdout.read()
connected = re.findall(r'([a-zA-Z0-9-]*) connected', xrandr)
connected = [c for c in connected if c != options.maindisplay]
cmd = "xrandr --output %s %s"
if options.connect or options.disconnect:
for c in connected:
if options.connect:
action = "--auto"
elif options.disconnect:
action = "--off"
p = Popen(cmd % (c, action), shell=True)
sts = os.waitpid(p.pid, 0)
|