Commit Graph

4 Commits

Author SHA1 Message Date
Durham Goode
410ca5052a reflog: fix devel-warn abotu dirstate.write 2015-10-26 17:51:36 -07:00
Christian Delahousse
980bc5ef4f reflogs: make reflog track remotebookmarks in remotenames
Test Plan: Added tests and ran them

Reviewers: #sourcecontrol, durham

Reviewed By: durham

Subscribers: durham

Differential Revision: https://phabricator.fb.com/D2566135

Tasks: 7526543

Signature: t1:2566135:1445487237:0ffec50e7cf23c5f3e06e147c59151e485602c2a
2015-10-21 11:45:32 -07:00
Durham Goode
5986c64daf Update reflog to work with upstream bookmark.write changes
Upstream no longer always uses bookmark.write to write.  Sometimes it goes
through the transaction API and uses bookmark._write. So now we wrap that
instead.

Also adds a test that would have caught this, since the existing commit/bookmark
tests did not exercise this new write path.
2014-10-14 17:23:09 -07:00
Durham Goode
bd577925d9 reflog: adds a reflog extension to fb-hgext
Summary:
This adds an extension that tracks the locations of the working copy and
bookmarks over time. It's still a proof of concept, but I want to get it
deployed to start getting feedback.

Running `hg reflog` by default shows the previous locations of the working
copy (most recent first).

  ~/myrepo> hg reflog
  Previous locations of '.':
  35a5fcfee452  rebase -d master
  32eee5e2d406  up .^
  b5d6dab4f900  up foo -C

Specifying a bookmark name shows the locations of that bookmark over time.

  ~/myrepo> hg reflog foo
  Previous locations of 'foo':
  d1a696044ec0  rebase -d master
  35a5fcfee452  rebase -d master
  32eee5e2d406  book foo -f

--verbose will show more information about each entry.

  ~/myrepo> hg reflog foo -v
  Previous locations of 'foo':
  35a5fcfee452 -> d1a696044ec0 durham   2014-10-01 18:32:14  rebase -d master
  32eee5e2d406 -> 35a5fcfee452 durham   2014-10-01 17:28:54  rebase -d master
  000000000000 -> 32eee5e2d406 durham   2014-10-01 17:28:30  book foo -f

It's currently stored as a single .hg/reflog file that is append only. Each
entry can store an arbitrary number of hashes (like storing 2 hashes for a merge
state working copy), which means we could also potentially use this to track
heads in branches as well.

It also (sorta) works with '-T json' for machine readable output:

  ~/myrepo> hg reflog foo -T json
  [
   {
    "command": "up .^",
    "date": "2014-10-02 13:54:45",
    "newhashes": "474ff61d1a36",
    "oldhashes": "d1a696044ec0",
    "user": "durham  "
   },
   {
    "command": "book foo",
  ...
  ]

Test Plan: Added tests. Ran them.

Reviewers: sid0, pyd, mpm, davidsp, akushner

Differential Revision: https://phabricator.fb.com/D1592875
2014-10-02 14:04:54 -07:00