プロジェクト

全般

プロフィール

Vote #65296

完了

Mercurial reads files from working dir instead of changesets

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
SCM_3
対象バージョン:
開始日:
2009/05/26
期日:
進捗率:

0%

予定工数:
category_id:
3
version_id:
27
issue_org_id:
3421
author_id:
5904
assigned_to_id:
11192
comments:
19
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

Currently the Mercurial plugin tries to read the file contents from the working directory (similar to the "staging area" in Git) instead of the changesets themselves. This means when you try to view a file that's been removed from whatever changeset is checked out in the working dir, it will be not found. Or, trying to view a certain version of a file that does exist in the working dir will just display whatever version was checked out. This seems to be undesirable behavior. It'd be nice to use a null working directory similar to Git's "bare" staging area.


journals

A friend is working on a patch for me. Will submit it when we have it.
--------------------------------------------------------------------------------
That'd be great if we could get this patch reviewed and applied. Currently, Mercurial support is nothing more than reading the contents out of some directory without this change. The change actually reads the repository itself.
--------------------------------------------------------------------------------
I'm not sure to understand the actual defect. Please include unit tests in your patch.
--------------------------------------------------------------------------------
I see the same issue.. I pointed the repository for a project to a local clone of the mercurial repository.. and clicking on Repository takes a long while (It's been about half an hour, and the repository page still wont open). This is the opensolaris kernel repository. If there's any information I can provide about the setup, let me know.
--------------------------------------------------------------------------------
Jean-Philippe Lang wrote:
> I'm not sure to understand the actual defect. Please include unit tests in your patch.

Do you understand what the staging area is in Git and why that is not the same thing as the repository? It's similar to that in Mercurial with the working director. I'm not sure what unit tests you are looking for. It won't show anything without a Mercurial repo attached to it.
--------------------------------------------------------------------------------
Luke Hoersten wrote:
> I'm not sure what unit tests you are looking for.

A test that would fail with the actual code and pass with your patch.

> It won't show anything without a Mercurial repo attached to it.

Indeed. That's why there are test repositories (see doc/RUNNING_TESTS)

--------------------------------------------------------------------------------
Umm, where are you getting this 'hg size' command from?? It doesn't exist on any version I have access to...
--------------------------------------------------------------------------------
Peter Fern wrote:
> Umm, where are you getting this 'hg size' command from?? It doesn't exist on any version I have access to...

Ian (the guy who wrote the patch) wrote a Mercurial plugin to give size. If it's not there it should just show '-' I think.
--------------------------------------------------------------------------------
Can you provide the mercurial plugin here?
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Peter Fern wrote:
> I think you'll find that's incorrect, and looking at the patch, it doesn't modify the 'cat' method in any way other than to add a default identifier of 'tip'...

Add a file to your Mercurial, commit, then delete and commit. If you try to view that file through Redmine, it will say it's not there because it's trying to pull it from your working directory instead of the changeset itself.
--------------------------------------------------------------------------------
In the mean time, I've added the size method, and a conditional in the model for my upcoming patchset to try the scm.size method and fall back to accessing the filesystem if that returns nil.
--------------------------------------------------------------------------------
Luke Hoersten wrote:
> Add a file to your Mercurial, commit, then delete and commit. If you try to view that file through Redmine, it will say it's not there because it's trying to pull it from your working directory instead of the changeset itself.

That wasn't happening here, but there were some errors handling revisions, etc - the 'entry does not exist in the repository' error is generic, so it's likely some other error was causing your problem, since the cat code currently in trunk works as expected.

Thanks for uploading the size extension, that's working great, and once I do some more testing, I'll get my patch up and link it to this issue for you to test.

If you're still in touch with Ian, can you ask him why he used @"glob:#{path}**"@ instead of @"path:#{path}"@ in the 'entries' method for the patch attached here?
--------------------------------------------------------------------------------
Peter Fern wrote:
> since the cat code currently in trunk works as expected.

Actually, the problem was likely that mercurial wasn't getting passed a revision when calling cat, which is also fixed in my upcoming patchset
--------------------------------------------------------------------------------
Peter Fern wrote:
> Peter Fern wrote:
> > since the cat code currently in trunk works as expected.
>
> Actually, the problem was likely that mercurial wasn't getting passed a revision when calling cat, which is also fixed in my upcoming patchset

Sounds very likely. I'll give it a try when you're ready.
Thanks for all the work!
--------------------------------------------------------------------------------
I can't set issue relationships, but the patch is at #4455
--------------------------------------------------------------------------------
I finish unit and functional test of this feature.
http://github.com/marutosi/redmine/tree/hg-overhaul-0.9
http://github.com/marutosi/redmine/commit/4c8794959c06205ba133ea7cdda59e4984d75915

--------------------------------------------------------------------------------
Note 17 is obsolete. Please see #4455.
--------------------------------------------------------------------------------
Fixed in r4864.
--------------------------------------------------------------------------------


related_issues

relates,Closed,4455,Mercurial overhaul
duplicates,Closed,6458,Mercurial View just a directory browser

Admin Redmine さんが3年以上前に更新

  • カテゴリSCM_3 にセット
  • 対象バージョン1.2.0_27 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0