Changeset 466
- Timestamp:
- 05/19/08 09:31:13
(8 months ago)
- Author:
- jmowery
- Message:
defaulting a function argument to a function call does not work as originally expected
defaults changed to None with initialization inside the call
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r465 |
r466 |
|
| 60 | 60 | return path |
|---|
| 61 | 61 | |
|---|
| 62 | | def collect_dirs(path, stop=os.getcwd()): |
|---|
| | 62 | def collect_dirs(path, stop=None): |
|---|
| 63 | 63 | '''Get a list of the absolute paths to each directory in path until stop''' |
|---|
| 64 | 64 | dir_list = [] |
|---|
| | 65 | if stop is None: |
|---|
| | 66 | stop = os.getcwd() |
|---|
| 65 | 67 | path = os.path.realpath(os.path.expanduser(path)) |
|---|
| 66 | 68 | if not in_subdir(path, stop): |
|---|
| … | … | |
| 245 | 247 | return times |
|---|
| 246 | 248 | |
|---|
| 247 | | def find_recent(self, name, date=int(time.time())): |
|---|
| | 249 | def find_recent(self, name, date=None): |
|---|
| 248 | 250 | '''Return the most recent version of name as of date.''' |
|---|
| | 251 | if date is None: |
|---|
| | 252 | date = int(time.time()) |
|---|
| 249 | 253 | times = self.list_revisions(name) |
|---|
| 250 | 254 | cur = 0 |
|---|
| … | … | |
| 295 | 299 | self.modified = False |
|---|
| 296 | 300 | |
|---|
| 297 | | def rollback(self, date=int(time.time()), name='.', recursive=False): |
|---|
| | 301 | def rollback(self, date=None, name='.', recursive=False): |
|---|
| 298 | 302 | '''Roll back (or forward) to date. If name specifies a directory set the applied time of all files it contains to the most recent as of date; else operate only on name.''' |
|---|
| | 303 | if date is None: |
|---|
| | 304 | date = int(time.time()) |
|---|
| 299 | 305 | raise NotImplementedError |
|---|
| 300 | 306 | |
|---|
Download in other formats:
* Generating other formats may take time.