Changeset 677 in tailor
- Timestamp:
- 08/23/05 14:30:34 (8 years ago)
- Hash name:
- 20050823123034-97f81-e319b9b87edd789f67ab577caa08ace5e009a61d
- File:
-
- 1 edited
-
vcpx/tailor.py (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vcpx/tailor.py
r668 r677 14 14 __version__ = '0.9.8' 15 15 16 from optparse import OptionParser, OptionGroup, make_option16 from optparse import OptionParser, OptionGroup, Option 17 17 from config import Config 18 18 from project import Project … … 158 158 159 159 160 class RecogOption(Option): 161 """ 162 Make it possible to recognize an option explicitly given on the 163 command line from those simply coming out for their default value. 164 """ 165 166 def process (self, opt, value, values, parser): 167 setattr(values, '__seen_' + self.dest, True) 168 return Option.process(self, opt, value, values, parser) 169 170 160 171 GENERAL_OPTIONS = [ 161 make_option("-D", "--debug", dest="debug",172 RecogOption("-D", "--debug", dest="debug", 162 173 action="store_true", default=False, 163 174 help="Print each executed command. This also keeps " 164 175 "temporary files with the upstream logs, that are " 165 176 "otherwise removed after use."), 166 make_option("-v", "--verbose", dest="verbose",177 RecogOption("-v", "--verbose", dest="verbose", 167 178 action="store_true", default=False, 168 179 help="Be verbose, echoing the changelog of each applied " 169 180 "changeset to stdout."), 170 make_option("--configfile", metavar="CONFNAME",181 RecogOption("--configfile", metavar="CONFNAME", 171 182 help="Centralized storage of projects info. With this " 172 183 "option and no other arguments tailor will update " 173 184 "every project found in the config file."), 174 make_option("--encoding", metavar="CHARSET", default=None,185 RecogOption("--encoding", metavar="CHARSET", default=None, 175 186 help="Force the output encoding to given CHARSET, rather " 176 187 "then using the user default settings specified in the " … … 179 190 180 191 UPDATE_OPTIONS = [ 181 make_option("-F", "--patch-name-format", metavar="FORMAT",192 RecogOption("-F", "--patch-name-format", metavar="FORMAT", 182 193 help="Specify the prototype that will be used " 183 194 "to compute the patch name. The prototype may contain " … … 187 198 "setting it to the empty string means that tailor will " 188 199 "simply use the original changelog."), 189 make_option("-1", "--remove-first-log-line", action="store_true",200 RecogOption("-1", "--remove-first-log-line", action="store_true", 190 201 default=False, 191 202 help="Remove the first line of the upstream changelog. This " … … 193 204 "when using it's 'firstlogline' variable to build the " 194 205 "name of the patch."), 195 make_option("-N", "--dont-refill-changelogs", action="store_true",206 RecogOption("-N", "--dont-refill-changelogs", action="store_true", 196 207 default=False, 197 208 help="Do not refill every changelog, but keep them as is. " … … 202 213 203 214 BOOTSTRAP_OPTIONS = [ 204 make_option("-s", "--source-kind", dest="source_kind", metavar="VC-KIND",215 RecogOption("-s", "--source-kind", dest="source_kind", metavar="VC-KIND", 205 216 help="Select the backend for the upstream source " 206 217 "version control VC-KIND. Default is 'cvs'.", 207 218 default="cvs"), 208 make_option("-t", "--target-kind", dest="target_kind", metavar="VC-KIND",219 RecogOption("-t", "--target-kind", dest="target_kind", metavar="VC-KIND", 209 220 help="Select VC-KIND as backend for the shadow repository, " 210 221 "with 'darcs' as default.", 211 222 default="darcs"), 212 make_option("-R", "--repository", "--source-repository",223 RecogOption("-R", "--repository", "--source-repository", 213 224 dest="source_repository", metavar="REPOS", 214 225 help="Specify the upstream repository, from where bootstrap " 215 226 "will checkout the module. REPOS syntax depends on " 216 227 "the source version control kind."), 217 make_option("-m", "--module", "--source-module", dest="source_module",228 RecogOption("-m", "--module", "--source-module", dest="source_module", 218 229 metavar="MODULE", 219 230 help="Specify the module to checkout at bootstrap time. " … … 224 235 "target repository, you may want to give it a value with " 225 236 "darcs too even if it is otherwise ignored."), 226 make_option("-r", "--revision", "--start-revision", dest="start_revision",237 RecogOption("-r", "--revision", "--start-revision", dest="start_revision", 227 238 metavar="REV", 228 239 help="Specify the revision bootstrap should checkout. REV " … … 239 250 "'HEAD' means the latest version in all backends.", 240 251 default="INITIAL"), 241 make_option("-T", "--target-repository",252 RecogOption("-T", "--target-repository", 242 253 dest="target_repository", metavar="REPOS", default=None, 243 254 help="Specify the target repository, the one that will " 244 255 "receive the patches coming from the source one."), 245 make_option("-M", "--target-module", dest="target_module",256 RecogOption("-M", "--target-module", dest="target_module", 246 257 metavar="MODULE", 247 258 help="Specify the module on the target repository that will " 248 259 "actually contain the upstream source tree."), 249 make_option("--subdir", metavar="DIR",260 RecogOption("--subdir", metavar="DIR", 250 261 help="Force the subdirectory where the checkout will happen, " 251 262 "by default it's the tail part of the module name."), … … 253 264 254 265 VC_SPECIFIC_OPTIONS = [ 255 make_option("--use-svn-propset", action="store_true", default=False,266 RecogOption("--use-svn-propset", action="store_true", default=False, 256 267 dest="use_propset", 257 268 help="Use 'svn propset' to set the real date and author of " … … 300 311 defaults = {} 301 312 for k,v in options.__dict__.items(): 302 if k <> 'configfile': 313 if k.startswith('__'): 314 continue 315 if k <> 'configfile' and hasattr(options, '__seen_' + k): 303 316 defaults[k.replace('_', '-')] = str(v) 304 317
Note: See TracChangeset
for help on using the changeset viewer.
