Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generating history cache from indexer for files renamed in Mercurial totally broken #22

Closed
vladak opened this issue Mar 22, 2013 · 4 comments
Assignees

Comments

@vladak
Copy link
Member

vladak commented Mar 22, 2013

The history cache of renamed files in Mercurial repository is generated in useless way during reindexing (contrary to when generated by clicking on the History link).

This means the commit c8af363 will not be of any help.

@vladak
Copy link
Member Author

vladak commented Aug 15, 2013

The problem with melted filenames described on https://java.net/projects/opengrok/lists/dev/archive/2013-03/message/33 probably went away to some degree (or was hidden) with e7cd132.

@vladak
Copy link
Member Author

vladak commented Aug 30, 2013

Also, I discovered that findOriginalName() does not quite work correctly. It was comparing full revision string with short string which makes it fail for some of the changesets. This will be fixed too with this change.

@vladak
Copy link
Member Author

vladak commented Aug 30, 2013

Facts:

  • if user clicks on revision link in History view in the UI hg cat -r REV FILE is invoked and its output is displayed in HTML format. similarly when comparing 2 revisions, 2 such commands are invoked and their oututs compared and formatted.
  • hg cat -r REV FILE does not work for renamed files, for this to work the FILE needs to be the original file name in revision REV
  • hg log -f FILE follows the renames of given file through renames (f means follow), this allows to find the original name of the file so that it can be passed to the hg cat command above
  • reindex of the whole repository basically performs hg log on the top-level directory of the repo and converts the output into list of HistoryEntry objects (one object maps to one changeset), together with files changes in given revision. File based cache then inverts this list and constructs a Map which maps file name into list of revisions which changed that file. This does not work for renamed files because the current name only maps to revisions in which it was changed under current name, not to revisions in which it was changed under the old name(s). Although JDBC cache does not perform this inversion (it is performed when querying by the DB) it has similar problem.

The overall approach to this fix:

  • assemble a list of files which were changed (once or more, does not matter) during reindex
  • store history cache entries for never-renamed files as is done currently. Once this is over get the full history for renamed files using getHistory() (which is able to find the complete history of the file because it runs hg log -f FILE) and generate the history entries for these files separately.

@vladak
Copy link
Member Author

vladak commented Nov 5, 2013

For reference, this all started with #388.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant