Professional Documents
Culture Documents
Markus Zapke-Grndemann
Softwareentwickler seit 2001 Python, Django und Mercurial Inqbus GmbH & Co. KG
Verteilte Versionskontrollsysteme
Verteilte Versionskontrollsysteme
Kein zentrales Repository ntig (aber
mglich)
Jeder Client hat ein eigenes Repository Viele Operationen sind schneller als bei
einem zentralen Repository
hg
Mercurial
Verteiltes Versionskontrollsystem Mercurial v0.1 im April 2005 Fast vollstndig in Python geschrieben Plattformunabhngig Erweiterbar (Extensions) Einfach zu erlernen Open Source (GNU GPL 2)
- Version 0.1 unter 600 SLOC Python - Version 1.9.3 hat 52.656 SLOC Python (86% von 60.999 SLOC)
Lantiq
- Ehemals Wireline Communications Division von Inneon Technologies - Alle xDSL-Varianten, VoIP, WLAN, FTTx oder Gigabit Ethernet - Auswahl der Standorte: Europa (Neubiberg, Duisburg, Villach, Riga und Yakum), Nordamerika (Bedford, MA und Milpitas, CA) sowie in Asien-Pazik (Taipei, Singapur und Bangalore)
Das Projekt
Anforderungen
Angepasste Mercurial Distribution Linux (verschiedene RHEL Versionen) Windows (TortoiseHg) Zentraler Mercurial Server mit LDAP
Authentizierung
DevOps
Bildquelle: https://en.wikipedia.org/wiki/File:Devops.png
Mercurial Distribution
Mercurial Distribution
Red Hat Enterprise Linux Windows
TortoiseHg
RHEL 4.x und 5.x fr 32 und 64 bit http://modules.sourceforge.net/ Nicht alle Mercurial Extensions liegen als Python Package vor Linux Distribution im Einsatz als Client und Server
Mercurial Extensions
mercurial_keyring
https://pypi.python.org/pypi/mercurial_keyring
onsub
http://mercurial.selenic.com/wiki/OnsubExtension
projrc
http://mercurial.selenic.com/wiki/ProjrcExtension
hglock
https://pypi.python.org/pypi/hglock
versions
https://pypi.python.org/pypi/hg-versions
relink
http://mercurial.selenic.com/wiki/RelinkExtension
importfs
cc_import
Mercurial Server
Mercurial Server
Apache
Backend Projekt A
Client
Reverse Proxy
SSL LDAP Auth.
Backend Projekt B
Backend Projekt C
Supervisord WSGI + hgweb
Das Backend fr jedes Projekt luft unter dem Account des Projekts. Die Projekt-Admins verwalten die Repositories selbst. Jedes Projekt kann ber 100 Repositories haben. Jedes Backend kann eine andere Mercurial Version nutzen.
Mercurial Outposts
Mercurial Server Mercurial Client
Outpost
ClearCase Migration
ClearCase Migration
ClearCase Baseline Mercurial Tag Migration von Baselines als Mercurial
Revisions
printparents.py
"""printparents Prints the parents of a given revision. """ from mercurial import util
def printparents(ui, repo, node, **opts): """Print parent information""" ctx = repo[node] parents = ctx.parents() try: if opts['short']: ui.write('short %s %s\n' % (parents[0], parents[1])) elif opts['long']: ui.write('long %s %s\n' % (parents[0].hex(), parents[1].hex())) else: ui.write('default %s %s\n' % (parents[0], parents[1])) except IndexError: raise util.Abort('revision %s has only one parent' % node)
cmdtable = { 'print-parents': (printparents, [('s', 'short', None, 'print short form'), ('l', 'long', None, 'print long form')], '[options] REV') }
test-printparents.t
Test printparents extension: $ echo "[extensions]" >> $HGRCPATH $ echo "printparents=" >> $HGRCPATH $ hg init r $ cd r $ echo c1 > f1 $ hg commit -Am 0 adding f1 $ echo c2 > f2 $ hg commit -Am 1 adding f2 $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo c3 > f3 $ hg commit -Am 2 adding f3 created new head $ hg merge 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg commit -m 3 $ hg print-parents tip default 33960aadc16f c3adabd1a5f4 $ hg print-parents 2 abort: revision 2 has only one parent [255]
cram
Danke! Fragen?
@keimlink / www.keimlink.de / www.inqbus.de