commit:     10881a57c8b438b4b4e984ebdb375d14fb63d474
Author:     Devan Franchini <twitch153 <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 11 05:22:51 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sun Jun 15 00:36:41 2014 +0000
URL:        
http://git.overlays.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=10881a57

mercurial.py: Adds module branch support

---
 layman/overlays/mercurial.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/layman/overlays/mercurial.py b/layman/overlays/mercurial.py
index 7a5fe08..a1b7846 100644
--- a/layman/overlays/mercurial.py
+++ b/layman/overlays/mercurial.py
@@ -28,6 +28,8 @@ __version__ = "$Id: mercurial.py 236 2006-09-05 20:39:37Z 
wrobel $"
 
#-------------------------------------------------------------------------------
 
 import re
+import xml.etree.ElementTree as ET
+
 from   layman.utils             import path
 from   layman.overlays.source   import OverlaySource, require_supported
 
@@ -48,7 +50,8 @@ class MercurialOverlay(OverlaySource):
 
         super(MercurialOverlay, self).__init__(parent,
             config, _location, ignore)
-        self.branch = None
+        self.branch = self.parent.branch
+
 
     def _fix_mercurial_source(self, source):
         '''
@@ -77,6 +80,10 @@ class MercurialOverlay(OverlaySource):
         else:
             args = ['clone', src, target]
 
+        if self.branch:
+            args.append('-r')
+            args.append(self.branch)
+
         return self.postsync(
             self.run_command(self.command(), args, cmd=self.type),
             cwd=target)

Reply via email to