# # patch "git.cc" # from [443deb7ce70ed3351306902462f369952be5475f] # to [0e83b3818380a299c3d87096c1519bf21c689983] # # patch "git.hh" # from [7d4562a9da683e0b44154bef5a348585d6adbdda] # to [589f31afccee1c9c71fb1fd2124bde6d1816193a] # # patch "git_export.cc" # from [87dde326ac1905c46ace0488589641e193164a5c] # to [0f6e428a6e1deb0a2f927f13395307a364734e41] # # patch "git_import.cc" # from [0fd5b50535d4fe7d6076aebbf15f4dfa128dbf9d] # to [1296666d4d21a68bfed46d7165b0c50aa1bae27f] # ======================================================================== --- git.cc 443deb7ce70ed3351306902462f369952be5475f +++ git.cc 0e83b3818380a299c3d87096c1519bf21c689983 @@ -47,6 +47,8 @@ #include "file_io.hh" #include "git.hh" #include "mkstemp.hh" +#include "revision.hh" +#include "transforms.hh" using namespace std; using boost::shared_ptr; @@ -153,7 +155,8 @@ // this is used for incremental import. Being smart, it also // populates the commitmap with GIT commits it finds along the way. void -historical_gitrev_to_monorev(git_history &git, app_state &app, +historical_gitrev_to_monorev(string const &branch, git_mt_commitmap *commitmap, + app_state &app, git_object_id gitrid, revision_id &found_rid) { queue frontier; @@ -162,7 +165,7 @@ // All the ancestry should be at least already in our branch, so there is // no need to work over the whole database. set heads; - get_branch_heads(git.branch, app, heads); + get_branch_heads(branch, app, heads); for (set::const_iterator i = heads.begin(); i != heads.end(); ++i) frontier.push(*i); @@ -188,7 +191,8 @@ decode_base64(certs[0].inner().value, cv); git_object_id gitoid = cv(); - git.commitmap[gitoid()] = make_pair(rid, rev.new_manifest); + if (commitmap) + (*commitmap)[gitoid()] = make_pair(rid, rev.new_manifest); if (gitoid == gitrid) { ======================================================================== --- git.hh 7d4562a9da683e0b44154bef5a348585d6adbdda +++ git.hh 589f31afccee1c9c71fb1fd2124bde6d1816193a @@ -15,6 +15,7 @@ #include "database.hh" typedef hexenc git_object_id; +typedef std::map > git_mt_commitmap; struct git_person @@ -34,7 +35,8 @@ void capture_git_cmd_output(boost::format const &fmt, std::filebuf &fbout); void capture_git_cmd_io(boost::format const &fmt, data const &input, std::filebuf &fbout); -void historical_gitrev_to_monorev(git_history &git, app_state &app, +void historical_gitrev_to_monorev(std::string const &git, git_mt_commitmap *commitmap, + app_state &app, git_object_id gitrid, revision_id &found_rid); #endif // __GIT_HH__ ======================================================================== --- git_export.cc 87dde326ac1905c46ace0488589641e193164a5c +++ git_export.cc 0f6e428a6e1deb0a2f927f13395307a364734e41 @@ -550,7 +550,7 @@ try { revision_id rev; - historical_gitrev_to_monorev(git, app, gitrev, rev); + historical_gitrev_to_monorev(git.branch, NULL, app, gitrev, rev); } catch (std::exception &e) { ======================================================================== --- git_import.cc 0fd5b50535d4fe7d6076aebbf15f4dfa128dbf9d +++ git_import.cc 1296666d4d21a68bfed46d7165b0c50aa1bae27f @@ -101,7 +101,7 @@ { git_db db; - map > commitmap; + git_mt_commitmap commitmap; map filemap; ticker n_revs; @@ -475,7 +475,7 @@ } else { - historical_gitrev_to_monorev(git, app, param, parent_rev); + historical_gitrev_to_monorev(git.branch, &git.commitmap, app, param, parent_rev); app.db.get_revision_manifest(parent_rev, parent_mid); } @@ -669,7 +669,7 @@ } else if (type == "commit") { - historical_gitrev_to_monorev(git, app, gitoid, rev); + historical_gitrev_to_monorev(git.branch, &git.commitmap, app, gitoid, rev); return true; } else