Closed
Bug 437397
Opened 18 years ago
Closed 18 years ago
change pushlog hook to use sqlite
Categories
(Release Engineering :: General, defect)
Release Engineering
General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: ted, Assigned: ted)
References
Details
Attachments
(1 file)
|
3.80 KB,
patch
|
benjamin
:
review+
|
Details | Diff | Splinter Review |
I've rewritten the hg pushlog hook to use a sqlite database for storage, and written a converter script from the old flat file format. I haven't tested this on a CentOS system, only on my Mac, so I'm a little worried about the right sqlite package being available, but I can probably work around that if need be.
Pushlog feed changes to follow in a separate bug.
Attachment #323864 -
Flags: review?(benjamin)
Comment 1•18 years ago
|
||
Comment on attachment 323864 [details] [diff] [review]
hghooks patch
>+def log(ui, repo, node, **kwargs):
>+ pushdb = os.path.join(repo.path, 'pushlog.db')
>+ createdb = False
>+ if not os.path.exists(pushdb):
>+ createdb = True
>+ conn = sqlite.connect(pushdb)
>+ if createdb:
>+ createpushdb(conn)
>+ d = datetime.utcnow().replace(microsecond=0)
>+ conn.execute("INSERT INTO pushlog (node, user, date) values(?,?,?)",
>+ (node, os.environ['USER'], d.isoformat()+"Z"))
>+ conn.commit()
The python hooks documentation says that hooks should "return False" to indicate success.
Other than that, this looks good!
Attachment #323864 -
Flags: review?(benjamin) → review+
Comment 2•18 years ago
|
||
Comment on attachment 323864 [details] [diff] [review]
hghooks patch
The RFEs I had should probably work fine on this, too.
| Assignee | ||
Comment 3•18 years ago
|
||
Pushed to bsmedberg's hghooks repo. Will file a followup on getting this installed, once I get the web bits done.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Updated•12 years ago
|
Product: mozilla.org → Release Engineering
You need to log in
before you can comment on or make changes to this bug.
Description
•