問題描述
我很尷尬地説,儘管我的插件已經在存儲庫已經存在多年了,已經有超過 30 萬的下載量,但我對使用 tortoise svn 更新插件的程序有點無知。
在這裏有很多關於 svn 的問題,但他們只是進一步困惑我:-z
不知何故,我已經管理到目前為止,但我需要知道正確的程序更新我的插件到新版本,提交中繼線和製作一個標籤目錄。
這是我一直在做的。
-
在我的本地代碼插件更新,直到我很高興
-
將本地插件文件夾中的所有文件複製到/trunk /(插件和自述文件已更新版本號)
-
提交 trunk 目錄
-
右鍵單擊 trunk 目錄並選擇 create branch /tag 並將其設置為複製到/tags /中的文件夾,其名稱為版本號
這是正確的和正確的順序嗎?如果沒有,什麼是正確的方法?
還有關於版本號…
由於某些原因,我在上次更新時從 2.8.1 版本升級到了 2.81.2,這是否意味着如果我將下一個版本號更改為 2.81.2,那麼它將不會顯示在具有版本 2.81.2 的人員的儀錶板中的更新 2.9?
wordpress 如何確定哪個是最新版本,如果用户應該更新其版本?它是做一個 version_compare 嗎?那隻適用於正確的 php 版本格式嗎?例如。 2.9.2 被認為是低於 2.81.2 的版本? (因為,據瞭解,version_compare 從左邊開始,每個數字比較高/低,所以 9 被認為小於 81)
另一個問題,
如果我在代碼中發現一個愚蠢的錯誤,不會真正影響插件的工作,也可能是打字錯誤或附加圖像。什麼編輯和承諾使任何新的下載的插件包含更改?
我必須編輯樹幹和標籤文件夾並提交兩個?
最佳解決方案
I’m embarrassed to say that I am a bit clueless on the procedure used to update a plugin via tortoise svn even though my plugin has been on the repository for years and had over 300,000 downloads!
不要 SVN 對於很多人來説可能很棘手,所以讓我們來看看 step-by-step …
This is what I’ve been doing so far.
- code the plugin updates on my local until I’m happy with it
- copy over all the files inside my local plugin folder to the /trunk/ (the plugin and readme file have updated version numbers)
- commit the trunk directory
- right click the trunk directory and choose create branch/tag and set it to copy to a folder in /tags/ with the name being the version number
Is that correct and in the right order? if not, what is the correct way?
幾乎…
你應該遵循的步驟:
-
在本地編寫插件更新,直到您滿意為止
-
在
readme.txt文件中增加”stable” 標籤以匹配新版本號 -
將本地更新複製到本地插件文件夾的
/trunk目錄中 -
提交整個插件,以將更改保存到存儲庫中
/trunk -
右鍵單擊
/trunk並創建一個新標籤,複製到/tags/X.X.X,其中 x.x.x 是readme.txt的”stable” 標籤中的相同版本 (步驟 2) -
提交整個插件來保存標籤
for some reason, I went from version 2.8.1 to 2.81.2 on my last update, does this mean that it wont show as an update available in the dashboards of people that have version 2.81.2 if I change the next version number to 2.9 ?
答對了。如果您提交 2.81.2 版本作為更新,並且人們實際下載了該更新,那麼當您釋放它時,它們將不會看到 2.9 。
how does wordpress determine which is the latest version and if the user should update their version? does it do a version_compare ? that only works with proper php version format doesn’t it? eg. 2.9.2 is considered a lower version than 2.81.2 ? (because, as I understand it, version_compare starts at the left and compares higher/lower for each digit so 9 would be considered less than 81)
究竟。一個標準的 PHP 版本比較將會看到 2.81.2 版本比 2.9 版本更新,因為 81> 9 。
我建議你下一個版本 3.0,然後在未來版本控制時要非常小心,以防止這種打字錯誤。
if I spot a silly mistake in the code that doesn’t really affect the working of the plugin, maybe a typo or an additional image. What do I edit and commit to make any new downloads of the plugin contain the change?
do I have to edit the trunk AND the tag folder and commit both?
如果您需要進行小的更改,請將其視為維護版本。我通常遵循這種版本化架構:
2 . 1 . 3 . 5
major minor maint build
構建數字我只在內部使用或測試版本… 你幾乎從來沒有看到一個構建號碼,除非我手動發送電子郵件給一個文件 (這是我如何分發不會破壞 WordPress 更新的 pre-release 版本) 。
如果我注意到一個即時版本的錯誤,我將快速修補併發佈一個維護版本。假設我已經發布了 2.2 版本的插件,有人注意到我忘記了在 noConflict() 模式下調用 jQuery 。我會做一個快速補丁,並立即釋放 2.2.1 。
版本中的增量將強制 WordPress 識別更新,並向已安裝版本 2.2 的任何人提供修復。
要釋放維護版本,您需要遵循完全相同的步驟,就像您正在發佈系統的完整版本一樣。所以進行更改,增加 readme.txt 中的版本,提交/trunk,標籤等。
但是,一旦你標記了一些東西,你永遠不會再改變它。想想你的/tags 文件夾是及時凍結的。該文件夾中的每個版本都是您的插件在特定時間點的快照。您不應該直接更改/tags 文件夾中的任何文件。
如果你發現自己覺得這可能是個好主意,那麼你可以在頭後面打個盹,然後發佈一個維護版本:-)
正如彼得所説,我寫了 a good set of step-by-step instructions earlier … 但網站似乎已經失去了我的截圖。這是另一個版本的相同的 step-by-step 指南與截圖從 Tortoise 託管在我自己的網站:http://eamann.com/tech/how-to-publish-a-wordpress-plugin-subversion/
參考文獻
注:本文內容整合自 Google/Baidu/Bing 輔助翻譯的英文資料結果。如果您對結果不滿意,可以加入我們改善翻譯效果:薇曉朵技術論壇。