Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9.2, 1.9.3, and 2.0

sync: add tooltips and keychain files to [auth] configuration

Changeset 2a633edea4b7

Parent 7a49c8f3ff03

by Steve Borho

Changes to one file · Browse files at 2a633edea4b7 Showing diff from parent 7a49c8f3ff03 Diff from another changeset...

 
956
957
958
 
 
 
 
 
 
959
960
961
 
 
 
 
 
962
963
964
965
 
 
 
 
966
967
968
 
 
 
 
 
 
 
 
 
 
 
 
969
970
971
972
 
 
 
 
 
 
 
973
974
975
 
1004
1005
1006
 
 
1007
1008
1009
 
1013
1014
1015
1016
1017
1018
1019
1020
 
 
 
 
 
 
 
 
 
 
1021
1022
1023
 
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
 
1038
1039
1040
1041
1042
1043
1044
1045
 
1049
1050
1051
 
 
 
 
 
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
@@ -956,20 +956,54 @@
  form.addRow(_('Schemes'), self.schemes)     self.prefixentry = QLineEdit(host) + self.prefixentry.setToolTip( +_('''Either * or a URI prefix with or without the scheme part. The +authentication entry with the longest matching prefix is used (where * matches + everything and counts as a match of length 1). If the prefix doesn't include + a scheme, the match is performed against the URI with its scheme stripped as + well, and the schemes argument, q.v., is then subsequently consulted.'''))   form.addRow(_('Prefix'), self.prefixentry)     self.userentry = QLineEdit(user) + self.userentry.setToolTip( +_('''Optional. Username to authenticate with. If not given, and the remote +site requires basic or digest authentication, the user will be prompted for +it. Environment variables are expanded in the username letting you do +foo.username = $USER.'''))   form.addRow(_('Username'), self.userentry)     self.pwentry = QLineEdit(pw)   self.pwentry.setEchoMode(QLineEdit.Password) + self.pwentry.setToolTip( +_('''Optional. Password to authenticate with. If not given, and the remote +site requires basic or digest authentication, the user will be prompted for +it.'''))   form.addRow(_('Password'), self.pwentry)   self.layout().addLayout(form)   + self.keyentry = QLineEdit(user) + self.keyentry.setToolTip( +_('''Optional. PEM encoded client certificate key file. Environment variables +are expanded in the filename.''')) + form.addRow(_('User Certificate Key File'), self.keyentry) + + self.chainentry = QLineEdit(user) + self.chainentry.setToolTip( +_('''Optional. PEM encoded client certificate chain file. Environment variables +are expanded in the filename.''')) + form.addRow(_('User Certificate Chain File'), self.chainentry) +   self.globalcb = QCheckBox(_('Save this configuration globally'))   self.globalcb.setChecked(True)   self.layout().addWidget(self.globalcb)   + txt = _('Auth section %smanual page%s') % ( + '<a href="http://www.selenic.com/mercurial/hgrc.5.html#auth">', + '</a>') + self.lbl = QLabel(txt) + self.lbl.setOpenExternalLinks(True) + self.layout().addWidget(self.lbl) +   BB = QDialogButtonBox   bb = QDialogButtonBox(BB.Help|BB.Save|BB.Cancel)   bb.rejected.connect(self.reject) @@ -1004,6 +1038,8 @@
  prefix = hglib.fromunicode(self.prefixentry.text())   username = hglib.fromunicode(self.userentry.text())   password = hglib.fromunicode(self.pwentry.text()) + key = hglib.fromunicode(self.keyentry.text()) + chain = hglib.fromunicode(self.chainentry.text())   alias = hglib.fromunicode(self.aliasentry.text())   if alias+'.prefix' in cfg['auth']:   if not qtlib.QuestionMsgBox(_('Confirm authentication replace'), @@ -1013,11 +1049,16 @@
  cfg.set('auth', alias+'.schemes', schemes)   cfg.set('auth', alias+'.username', username)   cfg.set('auth', alias+'.prefix', prefix) - key = alias+'.password' - if password: - cfg.set('auth', key, password) - elif not password and key in cfg['auth']: - del cfg['auth'][key] + def setorclear(item, value): + item = '.'.join([alias, item]) + if value: + cfg.set('auth', item, value) + elif not value and item in cfg['auth']: + del cfg['auth'][item] + setorclear('password', password) + setorclear('key', key) + setorclear('cert', chain) +   self.repo.incrementBusyCount()   try:   wconfig.writefile(cfg, fn)