Sponsorised links
June 2008
Tailor - DarcsWiki
Tailor is a tool to migrate or replicate changesets between ArX, Bazaar, Bazaar-NG, CVS, Codeville, Darcs, Git, Mercurial, Monotone, Subversion and Tla repositories.
May 2008
InfoQ: Distributed Version Control Systems: A Not-So-Quick Guide Through
Since Linus Torvalds presentation at Google about git in May 2007, the adoption and interest for Distributed Version Control Systems has been constantly rising. We will introduce the concept of Distributed Version Control, see when to use it, why it may be better than what you're currently using, and have a look at three actors in the area: git, Mercurial and Bazaar.
InfoQ: Distributed Version Control Systems: A Not-So-Quick Guide Through
Since Linus Torvalds presentation at Google about git in May 2007, the adoption and interest for Distributed Version Control Systems has been constantly rising. We will introduce the concept of Distributed Version Control, see when to use it, why it may be better than what you're currently using, and have a look at three actors in the area: git, Mercurial and Bazaar.
InfoQ: Distributed Version Control Systems: A Not-So-Quick Guide Through
A guide to three major Distributed Version Control Systems: git, Mercurial and Bazaar.
Sponsorised links
April 2008
RockStarProgrammer - The Differences Between Mercurial and Git
Although mercurial may still feel nicer today, the change feels inevitable. This flood of people leaving centralized systems means that it's way easier to contribute to their projects than ever before. This is the important part. In the end, we all wi
January 2008
Choosing a Distributed Version Control System
Bazaar, Hg (Mercurial) ou Git sont-ils les dignes successeurs de SVN et CVS ? C'est ce que Dave DRIBIN compare dans son blog.
October 2007
July 2007
May 2007
January 2007
programmation-python.org
Mercurial est un système distribué de gestion de sources écrit en Python. Il permet à des développeurs de travailler avec leur code et de le versionner comme avec Subversion, mais sans avoir à dépendre d'un serveur centralisé: chaque modification est conservée localement, et le développeur peut à tout moment se synchroniser avec un autre repository, qu'il soit sur un serveur ou sur un autre poste de développement.
Un repository Mercurial est accessible entres autres en SSH, et peut être recopié localement pour être modifié (commande clone), puis mis à jour avec la commande push. L'utilisation de Mercurial est très similaire à celle de Subversion:
dabox:~ tarek$ hg
Mercurial Distributed SCM
basic commands (use "hg help" for the full list or option "-v" for details):
add add the specified files on the next commit
annotate show changeset information per file line
clone make a copy of an existing repository
commit commit the specified files or all outstanding changes
diff diff repository (or selected files)
export dump the header and diffs for one or more changesets
init create a new repository in the given directory
log show revision history of entire repository or files
parents show the parents of the working dir or revision
pull pull changes from the specified source
push push changes to the specified destination
remove remove the specified files on the next commit
revert revert files or dirs to their states as of some revision
serve export the repository via HTTP
status show changed files in the working directory
update update or merge working directory
Mettre en place un projet basé sur Mercurial consiste donc à mettre à disposition des développeurs un repository via un utilisateur SSH. Cette mise en place est expliquée sur cette page : http://www.selenic.com/mercurial/wiki/index.cgi/MultipleCommitters.
Mercurial propose, comme Subversion un système de hook pour effectuer des opérations lorsqu'un développeur "push" des modifications sur le serveur désigné comme "central". Un script pour envoyer des mails à chaque push est fourni sur le site, mais n'est pas très souple (script shell basic).
Voici un script Python qui offre un peu plus de souplesse:
#!/usr/bin/python
import sys
import os
import smtplib
from email.MIMEText import MIMEText
from ConfigParser import ConfigParser
from email.Utils import formatdate
conffile = os.path.join(os.path.dirname(__file__), 'commithook.conf')
config = ConfigParser()
config.read(conffile)
def command(cmd):
return os.popen(cmd, 'r').read()
def send_mail(log, email, subject):
msg = MIMEText(log, 'plain', 'UTF-8')
sender = config.get('configuration', 'sender')
prefix = config.get('configuration', 'prefix')
msg['From'] = sender
msg['To'] = email
msg['Date'] = formatdate(localtime=True)
msg['Subject'] = '%s %s' % (prefix, subject)
server = smtplib.SMTP('localhost')
try:
server.sendmail(sender, [email], msg.as_string())
finally:
server.quit()
if __name__ == '__main__':
hg_node = os.getenv('HG_NODE')
subject = command('hg log -r %s | grep "^summary:" | cut -b 14-' % hg_node)
emails = config.get('configuration', 'emails').split(',')
for email in emails:
log = command('hg log -vpr %s' % hg_node)
send_mail(log, email, subject)
Il est associé à un fichier de configuration qui permet d'indiquer:
* le nom de l'expéditeur
* le préfix des mails
* la liste des emails
1
(12 marks)
