Edgewall Software
Modify

Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#10709 closed defect (duplicate)

Zip Download in TracMercurial is wrong

Reported by: anonymous Owned by: Christian Boos
Priority: high Milestone:
Component: version control Version: 0.12.3
Severity: normal Keywords: zip
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

A downloaded zip archive from the browser includes only the files which were modified in the current changeset and not all files representing the current changeset.

Attachments (0)

Change History (15)

comment:1 by Thijs Triemstra, 10 years ago

Keywords: zip added

comment:2 by anonymous, 10 years ago

I too ran into this problem. I discovered you can work around this by diffing current revision with revision 0 and then downloading changeset though it seems like this should be unnecessary

comment:3 by Christian Boos, 10 years ago

Milestone: plugin - mercurial
Owner: set to Christian Boos

I'll take a look.

comment:4 by Christian Boos, 9 years ago

Priority: normalhigh

Verified. Would be nice to fix this so that we can enable the download for the plugin itself.

comment:5 by huang, 9 years ago

same thing happen for git repo I don't know how about svn, does it only work on svn? It seems in the implementation, it implemented /trunk, /branches/*,/tags/* doesn't seems included the git file structures

comment:6 by schlamar, 9 years ago

Here is the issue. The SVN backend is ignoring old_rev if new_node.isdir: http://trac.edgewall.org/browser/trunk/tracopt/versioncontrol/svn/svn_fs.py?rev=11493#L672

comment:7 by schlamar, 9 years ago

Placing old_node = self.get_node(old_path, 0) at this line solves this issue.

However, there might be a better way because it seems really slow.

in reply to:  5 comment:8 by schlamar, 9 years ago

Replying to huang:

same thing happen for git repo I don't know how about svn, does it only work on svn?

Yes

It seems in the implementation, it implemented /trunk, /branches/*,/tags/* doesn't seems included the git file structures

Just set downloadable_paths = * in trac.ini if using git/hg.

in reply to:  6 comment:9 by schlamar, 9 years ago

Replying to schlamar:

Here is the issue. The SVN backend is ignoring old_rev if new_node.isdir: http://trac.edgewall.org/browser/trunk/tracopt/versioncontrol/svn/svn_fs.py?rev=11493#L672

Ah, not really… :-) The difference is actually old_path=%2F. If this is in the request, the SVN backend will download every file which is present in the selected changeset. If not, it will download only the files which were changed in the selected changeset.

See http://trac.edgewall.org/changeset/11711/?format=zip vs. http://trac.edgewall.org/changeset/11711/trunk?old_path=%2F&format=zip.

Here is the deal:

SVN is triggering the "special case for download" while hg is not, see

comment:10 by schlamar, 9 years ago

Ahh, normalize_path is transforming '/' to an empty string which triggers then the case "revert to Changeset" in the next few lines:

http://trac.edgewall.org/browser/trunk/trac/versioncontrol/web_ui/changeset.py?rev=11711#L258

comment:11 by schlamar, 9 years ago

IMO triggering the "special case for download" if old_path == '/' was a bad design decision back in #238. I would introduce a special request argument like download=1 to trigger this case.

comment:12 by schlamar <info@…>, 9 years ago

Cc: info@… added
Component: plugin/mercurialtimeline
Milestone: plugin - mercurial

Changed the component as this should be fixed in Trac itself.

comment:13 by schlamar <info@…>, 9 years ago

Component: timelineversion control

comment:14 by Christian Boos, 9 years ago

Resolution: duplicate
Status: newclosed

If this is only about the "download .zip from TracBrowser" feature, this should be fixed now by the changes related to #8919.

There are still a few glitches for downloading .zip corresponding to changesets.

comment:15 by schlamar <info@…>, 9 years ago

Cc: info@… removed

Yes, works now in 1.0.2dev.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.