Changeset 605 in tailor for vcpx/tailor.py
- Timestamp:
- 08/17/05 01:03:55 (8 years ago)
- Hash name:
- 20050816230355-97f81-1865f5c897840bbe65feccaef7743165c42aa285
- File:
-
- 1 edited
-
vcpx/tailor.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vcpx/tailor.py
r604 r605 31 31 """ 32 32 33 def prepareWorkingDirectory(self):34 """35 Prepare the working directory before the bootstrap.36 """37 38 dwd = self.workingDir()39 dwd.prepareWorkingDirectory(self.source)40 41 def checkoutUpstreamRevision(self):42 """43 Checkout a working copy from the upstream repository and import44 it in the target system.45 """46 47 dwd = self.workingDir()48 revision = self.config.get(self.name, 'start-revision', 'INITIAL')49 actual = dwd.checkoutUpstreamRevision(revision)50 dwd.initializeNewWorkingDir(self.source, actual, revision=='INITIAL')51 52 33 def _applyable(self, changeset): 53 34 """ … … 66 47 def _applied(self, changeset): 67 48 """ 68 S ave current status.49 Separate changesets with an empty line. 69 50 """ 70 51 … … 72 53 print 73 54 74 def applyPendingChangesets(self): 75 """ 76 Apply pending changesets, eventually fetching latest from upstream. 77 """ 55 def bootstrap(self): 56 """ 57 Bootstrap a new tailorized module. 58 59 First of all prepare the target system working directory such 60 that it can host the upstream source tree. This is backend 61 specific. 62 63 Then extract a copy of the upstream repository and import its 64 content into the target repository. 65 """ 66 67 self.log_info("Bootstrapping '%s'" % self.rootdir) 68 69 dwd = self.workingDir() 70 try: 71 dwd.prepareWorkingDirectory(self.source) 72 except: 73 self.log_error('Cannot prepare working directory!', True) 74 raise 75 76 revision = self.config.get(self.name, 'start-revision', 'INITIAL') 77 try: 78 actual = dwd.checkoutUpstreamRevision(revision) 79 except: 80 self.log_error("Checkout of '%s' failed!" % self.name, True) 81 raise 82 83 try: 84 dwd.initializeNewWorkingDir(self.source, actual, 85 revision=='INITIAL') 86 except: 87 self.log_error('Could not import checked out tree!', True) 88 raise 89 90 self.log_info("Bootstrap completed") 91 92 def update(self): 93 """ 94 Update an existing tailorized project. 95 """ 96 97 self.log_info("Updating '%s'" % self.name) 78 98 79 99 dwd = self.workingDir() … … 109 129 self.log_info("Update completed with no upstream changes") 110 130 111 def bootstrap(self):112 """113 Bootstrap a new tailorized module.114 115 First of all prepare the target system working directory such116 that it can host the upstream source tree. This is backend117 specific.118 119 Then extract a copy of the upstream repository and import its120 content into the target repository.121 """122 123 self.log_info("Bootstrapping '%s'" % self.rootdir)124 125 try:126 self.prepareWorkingDirectory()127 except:128 self.log_error('Cannot prepare working directory!', True)129 raise130 131 try:132 self.checkoutUpstreamRevision()133 except:134 self.log_error("Checkout of '%s' failed!" %135 self.name, True)136 raise137 138 self.log_info("Bootstrap completed")139 140 def update(self):141 """142 Update an existing tailorized project.143 """144 145 self.log_info("Updating '%s'" % self.name)146 147 try:148 self.applyPendingChangesets()149 except:150 self.log_error("Cannot update '%s'!" % self.name,151 True)152 raise153 154 self.log_info("Update completed")155 156 131 def __call__(self): 157 132 from shwrap import ExternalCommand … … 185 160 else: 186 161 self.update() 162 187 163 188 164 GENERAL_OPTIONS = [
Note: See TracChangeset
for help on using the changeset viewer.
