Mercurial > hg
comparison mercurial/shelve.py @ 48946:642e31cb55f0
py3: use class X: instead of class X(object):
The inheritance from object is implied in Python 3. So this should
be equivalent.
This change was generated via an automated search and replace. So there
may have been some accidental changes.
Differential Revision: https://phab.mercurial-scm.org/D12352
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 21 Feb 2022 13:08:28 -0700 |
parents | 6000f5b25c9b |
children | 63fd0282ad40 |
comparison
equal
deleted
inserted
replaced
48945:55d132525155 | 48946:642e31cb55f0 |
---|---|
66 # we never need the user, so we use a | 66 # we never need the user, so we use a |
67 # generic user for all shelve operations | 67 # generic user for all shelve operations |
68 shelveuser = b'shelve@localhost' | 68 shelveuser = b'shelve@localhost' |
69 | 69 |
70 | 70 |
71 class ShelfDir(object): | 71 class ShelfDir: |
72 def __init__(self, repo, for_backups=False): | 72 def __init__(self, repo, for_backups=False): |
73 if for_backups: | 73 if for_backups: |
74 self.vfs = vfsmod.vfs(repo.vfs.join(backupdir)) | 74 self.vfs = vfsmod.vfs(repo.vfs.join(backupdir)) |
75 else: | 75 else: |
76 self.vfs = vfsmod.vfs(repo.vfs.join(shelvedir)) | 76 self.vfs = vfsmod.vfs(repo.vfs.join(shelvedir)) |
99 mtime = shelf.mtime() | 99 mtime = shelf.mtime() |
100 info.append((mtime, name)) | 100 info.append((mtime, name)) |
101 return sorted(info, reverse=True) | 101 return sorted(info, reverse=True) |
102 | 102 |
103 | 103 |
104 class Shelf(object): | 104 class Shelf: |
105 """Represents a shelf, including possibly multiple files storing it. | 105 """Represents a shelf, including possibly multiple files storing it. |
106 | 106 |
107 Old shelves will have a .patch and a .hg file. Newer shelves will | 107 Old shelves will have a .patch and a .hg file. Newer shelves will |
108 also have a .shelve file. This class abstracts away some of the | 108 also have a .shelve file. This class abstracts away some of the |
109 differences and lets you work with the shelf as a whole. | 109 differences and lets you work with the shelf as a whole. |
211 def delete(self): | 211 def delete(self): |
212 for ext in shelvefileextensions: | 212 for ext in shelvefileextensions: |
213 self.vfs.tryunlink(self.name + b'.' + ext) | 213 self.vfs.tryunlink(self.name + b'.' + ext) |
214 | 214 |
215 | 215 |
216 class shelvedstate(object): | 216 class shelvedstate: |
217 """Handle persistence during unshelving operations. | 217 """Handle persistence during unshelving operations. |
218 | 218 |
219 Handles saving and restoring a shelved state. Ensures that different | 219 Handles saving and restoring a shelved state. Ensures that different |
220 versions of a shelved state are possible and handles them appropriately. | 220 versions of a shelved state are possible and handles them appropriately. |
221 """ | 221 """ |