开发者

Using Mercurial with Branches - publishing to FTPonly accessible WebServers

开发者 https://www.devze.com 2023-03-08 14:54 出处:网络
We are a small team of developers working with a Web Application which is published using a Web Server that is only accessible throught FTP.

We are a small team of developers working with a Web Application which is published using a Web Server that is only accessible throught FTP.

Our workflow is the following one:

  • A developer is working out some requested feature locally
  • When its done, commits it and Pushes to a 'central' repository
  • Few times a day, one of developers publishes the files that have been changed to a testing WebSite, to let key users see how does features have been implemented.
  • Once in a week, we deploy to our production site

As our Webserver doesnt support SSH, we can't push changesets and update on the server, so we created a custom script which Transfers the changed files throught FTP.

Each time we use that script a new tag is created, so we know -using hg diff- the diference between tags (a release for us).

It was all fine until now, that we introduced branches in our workflow, to let a developer work on a radical changes in the code, and keep contributing in daily small changes which are published to production.

The problem is that hg diff doesnt support Branches (or seems that its still in development)

So, which would be the best way to do it ? some options we have been thinking about are:

  1. Mounting FTP as a Volume localy (using MacFuse or similar) and use mercurial push/update But would be so sloooow.
  2. Play around with Bundles and see if they can help us but seems quite complicated

Example

$ hg tag qa-001   /* init to see diferences QA Site */
$ hg tag prod-001 /* init to see diferences Production Site */
$ hg ci -m "working on a stable feature"
$ hg tag qa-002
$ hg ci -m "change on the stable feature"
$ hg tag qa-003
$ hg tag prod-002
$ hg ci -m "another change on sta开发者_Go百科ble"
$ hg pull ../CentralRepo  /*Where there is another Branch with unstable files*/

With last operation, a new head is created , so now there are two heads (stable, and unstable branch)

$hg diff -r qa-003 -r tip

The Result of hg diff is showing up the Unstable Files without doing the merge

Many Thanks for your comments


In your example, you are creating tags, not (named) branches. Tags won't help you to create separate lines of development: they are just stand-alone identifiers assigned with particular revisions.

Creating branches

To start using branches, you probably want to review some tutorials, such as:

  • Chapter 8. Managing releases and branchy development (from Bryan O'Sullivan's book)
  • A Guide to Branching in Mercurial (Steve Losh)

Based on your description, you probably want to create prod and qa branches based on your current default branch, as well as any feature / topic branches you might want for radical changes.

Once you have these branches in place, it's very easy to compare them, merge between them, see what changes are pending from one to the other, and so on as your workflow demands.

Bundles

  1. Play around with Bundles and see if they can help us but seems quite complicated

If you only have FTP access, then bundles probably won't help you. You could upload a bundle to the server via FTP, but you would need to be able to run hg on the server to unpack the bundle into a repository.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号