# # # patch "mtn_cvs/cvs_client.cc" # from [5b3548832cd29072c3733a9fb5157c89a72c621c] # to [25a14cbdfc5ee65053dff9cff2b9a604324c3ace] # # patch "mtn_cvs/cvs_client.hh" # from [d4fc5e3982d02b5b1e982cc5a9e85af3e3a688d3] # to [e1be2fff144fdf59267c3fb83f0c9a664c5c8465] # # patch "mtn_cvs/cvs_sync.cc" # from [0e9afb0cb2937b13cde55913fa95ec5853d201d3] # to [907df8ec09bb24c1b0f9937effd2b7d1465a4d6f] # # patch "mtn_cvs/cvs_sync.hh" # from [0e4c288d7874e48d1ae1846a53ea65437e950ec2] # to [859816132966f9bd79496cf9a94e7ebccb108bef] # ============================================================ --- mtn_cvs/cvs_client.cc 5b3548832cd29072c3733a9fb5157c89a72c621c +++ mtn_cvs/cvs_client.cc 25a14cbdfc5ee65053dff9cff2b9a604324c3ace @@ -1226,6 +1226,7 @@ void cvs_client::Update(const std::vecto { if (lresult[0].second=="Created" || lresult[0].second=="Update-existing") { I(lresult.size()==7); I(lresult[6].first=="data"); + I(lresult[4].first=="mode"); dir=lresult[1].second; result.file=lresult[2].second; I(!result.file.empty()); @@ -1234,6 +1235,7 @@ void cvs_client::Update(const std::vecto result.file=rcs_file2path(root+"/"+result.file); result.contents=lresult[6].second; parse_entry(lresult[3].second,result.new_revision,result.keyword_substitution); + result.mode=permissions2int(lresult[4].second); cb(result); result=update(); state=st_normal; @@ -1241,6 +1243,7 @@ void cvs_client::Update(const std::vecto else if (lresult[0].second=="Rcs-diff") { I(lresult.size()==7); I(lresult[6].first=="data"); + I(lresult[4].first=="mode"); dir=lresult[1].second; result.file=lresult[2].second; I(!result.file.empty()); @@ -1249,6 +1252,7 @@ void cvs_client::Update(const std::vecto result.file=rcs_file2path(root+"/"+result.file); result.patch=lresult[6].second; parse_entry(lresult[3].second,result.new_revision,result.keyword_substitution); + result.mode=permissions2int(lresult[4].second); cb(result); result=update(); state=st_normal; @@ -1281,10 +1285,11 @@ void cvs_client::Update(const std::vecto else if (lresult[0].second=="Mod-time") { result.mod_time=mod_time2time_t(lresult[1].second); } - else if (lresult[0].second=="Merged") + else if (lresult[0].second=="Merged") // probably unused? { I(state==st_merge); I(lresult.size()==7); I(lresult[6].first=="data"); + I(lresult[4].first=="mode"); dir=lresult[1].second; result.file=lresult[2].second; I(!result.file.empty()); @@ -1293,8 +1298,12 @@ void cvs_client::Update(const std::vecto result.file=rcs_file2path(root+"/"+result.file); result.contents=lresult[6].second; // strictly this is unnecessary ... parse_entry(lresult[3].second,result.new_revision,result.keyword_substitution); + result.mode=permissions2int(lresult[4].second); E(false, F("Update ->%s of %s exposed CVS bug\n") % result.new_revision % result.file); + cb(result); + result=update(); + state=st_normal; } else if (lresult[0].second=="error") { I(state==st_merge); ============================================================ --- mtn_cvs/cvs_client.hh d4fc5e3982d02b5b1e982cc5a9e85af3e3a688d3 +++ mtn_cvs/cvs_client.hh e1be2fff144fdf59267c3fb83f0c9a664c5c8465 @@ -27,7 +27,8 @@ class cvs_client std::string file; time_t mod_time; bool removed; - update() : mod_time(-1),removed() {} + int mode; + update() : mod_time(-1),removed(),mode(0644) {} }; struct rlog_callbacks { // virtual void file(const std::string &file,)=0; ============================================================ --- mtn_cvs/cvs_sync.cc 0e9afb0cb2937b13cde55913fa95ec5853d201d3 +++ mtn_cvs/cvs_sync.cc 907df8ec09bb24c1b0f9937effd2b7d1465a4d6f @@ -518,6 +518,7 @@ void cvs_repository::store_checkout(std: const_cast(s2->size)=c.contents.size(); file_contents=c.contents; const_cast(s2->keyword_substitution)=c.keyword_substitution; + const_cast(s2->mode)=c.mode; } } @@ -533,6 +534,7 @@ void cvs_repository::store_checkout(std: const_cast(s2->size)=c.contents.size(); file_contents=c.contents; const_cast(s2->keyword_substitution)=c.keyword_substitution; + const_cast(s2->mode)=c.mode; } } ============================================================ --- mtn_cvs/cvs_sync.hh 0e4c288d7874e48d1ae1846a53ea65437e950ec2 +++ mtn_cvs/cvs_sync.hh 859816132966f9bd79496cf9a94e7ebccb108bef @@ -47,10 +47,11 @@ struct file_state std::string log_msg; std::string author; std::string keyword_substitution; + int mode; - file_state() : since_when(), size(), patchsize(), dead() {} + file_state() : since_when(), size(), patchsize(), dead(), mode(0644) {} file_state(time_t sw,const std::string &rev,bool d=false) - : since_when(sw), cvs_version(rev), size(), patchsize(), dead(d) {} + : since_when(sw), cvs_version(rev), size(), patchsize(), dead(d), mode(0644) {} bool operator==(const file_state &b) const { return since_when==b.since_when && cvs_version==cvs_version; } bool operator<(const file_state &b) const;