Show More
@@ -159,8 +159,11 b' class changelog(baselog):' | |||||
159 | def tiprev(self): |
|
159 | def tiprev(self): | |
160 | t = self._db.execute( |
|
160 | t = self._db.execute( | |
161 | 'SELECT rev FROM changelog ' 'ORDER BY REV DESC ' 'LIMIT 1' |
|
161 | 'SELECT rev FROM changelog ' 'ORDER BY REV DESC ' 'LIMIT 1' | |
162 | ) |
|
162 | ).fetchone() | |
163 | return next(t) |
|
163 | ||
|
164 | if t is not None: | |||
|
165 | return t[0] | |||
|
166 | return -1 | |||
164 |
|
167 | |||
165 | def _partialmatch(self, id): |
|
168 | def _partialmatch(self, id): | |
166 | if wdirhex.startswith(id): |
|
169 | if wdirhex.startswith(id): |
@@ -49,6 +49,16 b' Now globally enable extension for the re' | |||||
49 | > log-index-cache-miss = yes |
|
49 | > log-index-cache-miss = yes | |
50 | > EOF |
|
50 | > EOF | |
51 |
|
51 | |||
|
52 | Test some edge cases around a commitless repo first | |||
|
53 | $ mkdir empty | |||
|
54 | $ cd empty | |||
|
55 | $ git init | |||
|
56 | Initialized empty Git repository in $TESTTMP/empty/.git/ | |||
|
57 | $ hg init --git | |||
|
58 | $ hg heads | |||
|
59 | [1] | |||
|
60 | $ cd .. | |||
|
61 | ||||
52 | Make a new repo with git: |
|
62 | Make a new repo with git: | |
53 | $ mkdir foo |
|
63 | $ mkdir foo | |
54 | $ cd foo |
|
64 | $ cd foo | |
@@ -377,3 +387,24 b' Deleting files should also work (this wa' | |||||
377 | $ hg rm beta |
|
387 | $ hg rm beta | |
378 | $ hg ci -m 'remove beta' |
|
388 | $ hg ci -m 'remove beta' | |
379 |
|
389 | |||
|
390 | This covers changelog.tiprev() (issue6510) | |||
|
391 | $ hg log -r '(.^^):' | |||
|
392 | heads mismatch, rebuilding dagcache | |||
|
393 | changeset: 5:ae1ab744f95b | |||
|
394 | user: test <test> | |||
|
395 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
396 | summary: Introduce file a/mu | |||
|
397 | ||||
|
398 | changeset: 6:80adc61cf57e | |||
|
399 | user: test <test> | |||
|
400 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
401 | summary: test interactive commit | |||
|
402 | ||||
|
403 | changeset: 7:116aee5ecdff | |||
|
404 | bookmark: master | |||
|
405 | tag: tip | |||
|
406 | user: test <test> | |||
|
407 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
408 | summary: remove beta | |||
|
409 | ||||
|
410 |
General Comments 0
You need to be logged in to leave comments.
Login now