# HG changeset patch
# User Simon Heimberg <sim...@besonet.ch>
# Date 1310591143 -7200
# Node ID ec328c7b07ae93d5b5b208374a83789c10c62b4c
# Parent  2d7f05998a8e12ea274ce26cad873a5452d490d4
clone: add a check box for creating a shared repository

doing invalid selection is not prevented (example: hg share --uncompressed)

diff -r 2d7f05998a8e -r ec328c7b07ae tortoisehg/hgqt/clone.py
--- a/tortoisehg/hgqt/clone.py  Mit Jul 13 23:02:11 2011 +0200
+++ b/tortoisehg/hgqt/clone.py  Mit Jul 13 23:05:43 2011 +0200
@@ -138,6 +138,8 @@
                 chktext(_('Include patch queue'), btnlabel=_('Browse...'),
                         btnslot=self.onBrowseQclone)
 
+        self.share_chk = QCheckBox(_('Shared repository'))
+
         self.proxy_chk = QCheckBox(_('Use proxy server'))
         optbox.addWidget(self.proxy_chk)
         useproxy = bool(self.ui.config('http_proxy', 'host'))
@@ -204,6 +206,7 @@
         self.uncomp_chk.toggled.connect(self.composeCommand)
         self.qclone_chk.toggled.connect(self.composeCommand)
         self.qclone_txt.textChanged.connect(self.composeCommand)
+        self.share_chk.toggled.connect(self.composeCommand)
         self.proxy_chk.toggled.connect(self.composeCommand)
         self.insecure_chk.toggled.connect(self.composeCommand)
         self.remote_chk.toggled.connect(self.composeCommand)
@@ -248,6 +251,8 @@
         self.qclone_chk.setVisible(visible)
         self.qclone_txt.setVisible(visible)
         self.qclone_btn.setVisible(visible)
+        enabled = hglib.extension_enabled('share')
+        self.share_chk.setVisible(visile and enabled)
         self.remote_chk.setVisible(visible)
         self.remote_text.setVisible(visible)
         self.startrev_chk.setVisible(visible and self.startrev_available())
@@ -257,6 +262,7 @@
         remotecmd = hglib.fromunicode(self.remote_text.text().trimmed())
         rev = hglib.fromunicode(self.rev_text.text().trimmed())
         startrev = hglib.fromunicode(self.startrev_text.text().trimmed())
+        share = False;
         if self.qclone_chk.isChecked():
             qclonedir = hglib.fromunicode(self.qclone_txt.text().trimmed())
             if qclonedir == '':
@@ -265,24 +271,27 @@
             cmdline = ['qclone']
             if not qclonedir in ['.hg\patches', '.hg/patches', '']:
                 cmdline += ['--patches', qclonedir]
+        elif self.share_chk.isChecked(): # check hg.islocal(source) ??
+            share = True
+            cmdline = ['share']
         else:
             cmdline = ['clone']
         if self.noupdate_chk.isChecked():
             cmdline.append('--noupdate')
-        if self.uncomp_chk.isChecked():
+        if self.uncomp_chk.isChecked() and not share:
             cmdline.append('--uncompressed')
-        if self.pproto_chk.isChecked():
+        if self.pproto_chk.isChecked() and not share:
             cmdline.append('--pull')
-        if self.ui.config('http_proxy', 'host'):
+        if self.ui.config('http_proxy', 'host') and not share:
             if not self.proxy_chk.isChecked():
                 cmdline += ['--config', 'http_proxy.host=']
-        if self.remote_chk.isChecked() and remotecmd:
+        if self.remote_chk.isChecked() and remotecmd and not share:
             cmdline.append('--remotecmd')
             cmdline.append(remotecmd)
-        if self.rev_chk.isChecked() and rev:
+        if self.rev_chk.isChecked() and rev and not share:
             cmdline.append('--rev')
             cmdline.append(rev)
-        if self.startrev_chk.isChecked() and startrev:
+        if self.startrev_chk.isChecked() and startrev and not share:
             cmdline.append('--startrev')
             cmdline.append(startrev)
         cmdline.append('--verbose')

------------------------------------------------------------------------------
Storage Efficiency Calculator
This modeling tool is based on patent-pending intellectual property that
has been used successfully in hundreds of IBM storage optimization engage-
ments, worldwide.  Store less, Store more with what you own, Move data to 
the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/
_______________________________________________
Tortoisehg-develop mailing list
Tortoisehg-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to