Branching in Subversion using TortoiseSVN

A branch in a Subversion code repository is used to isolate changes onto a new line of development, without disturbing the main branch (commonly called trunk). The new line of development is typically to implement a specific new feature, and will be merged into the main branch once it is stable.

I was working on integrating TI command-line interface (cli) code into the msp432logger project a few months ago when I diverted to electronics hardware and mechanical design before completing the integration. I didn’t want to check-in the extremely-preliminary cli code to trunk, but I also didn’t want to lose track of it either. The solution was to create a development branch for the work in progress.

Today, I need to create another branch. This time however it is to carry on development of a new feature so that the work in progress code can be shared among several developers.

Create branch

It is assumed that your repo follows the Subversion best practices directory structure, with trunk/, tags/ and branches/ sub-directories. It is also assumed that you have been working in trunk/ up until now.

Foresight

Right-click on the local repository workspace folder in Windows Explorer and pick TortoiseSVN -> Branch/tag… from the Context menu. Select the path for the branch, a log message, and the base for the branch. You can select HEAD or a specific version to base the branch on. If there are no edited files in the working copy, the Copy dialog will default to using the most recent version as the base for the branch.

tortoisesvn-07-create-branch-from-head-ok-comments

Hindsight

If you are creating the branch in hindsight and have already made file edits, TortoiseSVN will warn you that basing the branch on HEAD will result in loss of those edits.

tortoisesvn-01-create-branch

In this case, you will likely want your edits (and any new files) to become the first commit in the new branch. In this case, close the warning and select Create copy in the repository from: Working copy.

tortoisesvn-05-create-branch-ok-comments

Working in the branch

In the previous examples, we selected Switch working copy to new branch/tag in the Copy dialogue. You can verify working copy was switched to the new branch by checking the condition of the working copy using the Subversion cli.

tortoisesvn-09-svn-info

You can also see the new branch in TortoiseSVN’s Revision Graph.

tortoisesvn-10-svn-revision-graph

If you didn’t check Create copy in the repository from: Working copy when you created the branch, or if you are another developer and want to start working in the new branch, you will need to Switch to the branch in your working copy.

Right-click on the local repository workspace folder in Windows Explorer and pick TortoiseSVN -> Switch… from the Context menu, and select the path for the branch to switch to.

tortoisesvn-10-switch-to-branch

You can confirm your working copy has switched to the desired branch using the Subversion cli command “svn info” as previously described before continuing development in the new branch.

Checking in code is as before, but first check the Commit to: line at the top of the Commit dialogue to confirm the code will be checked into the correct branch.

tortoisesvn-11-first-commit

After clicking OK, you should see that the check-in completed successfully.

tortoisesvn-12-first-commit-finished

and the Revision Graph now includes the check-in.

tortoisesvn-12-new-revision-graph

Simple!

I will update this post to include merging the branch back into trunk when I get to that part, or earlier if I get requests.

Configuring WebERP

This post is a work in progress. When complete it will document the basic configuration of a WebERP system.

WackoWiki

WebERP provides optional wiki integration, with links to standard wiki pages for WebERP users to enter information on customers, products and suppliers for later reference by themselves or others.

WebERP in particular supports wiki integration with WackoWiki , a popular lightweight wiki provided under a BSD license and coded in PHP.

Install

Download a release archive from the WackoWiki project on Sourceforge https://sourceforge.net/projects/wackowiki/. Follow the installation instructions on the Sourceforge project wiki http://wackowiki.sourceforge.net/doc/Doc/English/Installation.

WebERP

Create stock categories

Create a stock (inventory) categories as needed for real items as well as virtual items (e.g. Projects and Labor) Items. Main Menu -> Setup -> Inventory Setup -> Inventory Categories Maintenance.

Create a category for project virtual stock items.

weberp-inventory-category-maintenance

Create a category for labor virtual stock items.

weberp-labour-item-inventory-category

Create a work center

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Main Menu -> Manufacturing Maintenance -> Work Centre.

weberp-create-work-center

Create a customer

There are a number of configurations that must be done before a customer can be created.

  • At least one customer type must be created. Main Menu -> Setup -> Receivables/Payables Setup -> Customer Types.

weberp-create-customer-type

  • At least one Sales Type must be created. Main Menu -> Setup -> Receivables/Payables Setup -> Sales Types.

weberp-create-customer-create-price-list-2

  • A default sales region must be created. Main Menu -> Setup -> Receivables/Payables Setup -> Sales Types.

  

Create project and labor items

Create a Manufactured item to represent a project (it must be of type Manufactured so that a manufacturing work order can be created),

weberp-create-project-item-manufactured

and a Labour item of type Service/Labour to represent the project labor.

weberp-create-labour-item

Note that the new items will appear in an item search.

weberp-project-labour-items

Summary

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Using WebERP for project management

This post is a work in progress. When complete it will document how to use WebERP for project management. Also, basic WebERP system configuration has been moved to a separate post for clarity, see Configuring WebERP.

Timesheets and ERPs

The venerable timesheet has been around for a long time, but often part of a one-way process – from employee to payroll. However, the same information (who did what and how long did it take) also provides the foundation for effective project management.

If an organization has the need for a timesheet process AND it undertakes projects AND it has need of an ERP system for financial management, then managing projects and timesheets within the ERP provides a number of benefits, including:

  • Integrated data. Projects, people, hours, other expenses, purchase orders, production builds, bills of materials, etc., are conveniently managed in one system, including coordinated relationships.
  • Visible, trustable project management.
  • Readily scales as people are added.
  • Can be used to save money and generate revenue. For Canadian companies, project records are required to access the SR&ED (Scientific Research and Experimental Development) tax incentive program.

Strategies using WebERP

Although WebERP doesn’t specifically support projects, two strategies using existing functionality are available for managing projects .

  • Use an Item (part number) to model a project. Create an item (part number) for each project, and use a work order to capture the labor and other project costs. As many labor type items can be created as necessary, and a labor type can be defined when a stock category is defined for a stock type – which allows for GL entries to recover labor (CR a P&L account and DR WIP) when there is an issue of labor to a work order. These labor items can also be part of the bill of material at a particular work center, and work centers can be mapped to labor items. Having created a work order, you then issue materials and labor to it and receive finished goods from it. When all the materials and labor have been issued and the finished goods received from it the work order is closed and the stock of the (unsold) finished items are revalued as necessary.
  • Use a Contract to model a project. webERP contract functionality allows for entry of nominal items directly to a contract’s cost, and stock and labor can be issued to a contract work order. If necessary, multiple contracts can be used with each contract a different section of the project (e.g. prototype, software development…). Contracts can have dates associated with them, as well as inter-dependencies, and could be presented using a Gantt or PERT chart. You can read more about this strategy in a proposal written by WebERP founder, Phil Daintree (http://www.weberp.org/wiki/ProjectManagementPercentCompletion).

Goals

Goals in this investigation are to:

  • Demonstrate basic project management functionality possible using WebERP as-is.
  • Propose specific changes, such as a timesheet form, which will improve the user experience of managing projects without making significant changes to the code or database schema (following the 80/20 rule, achieving 80% of the desired features with 20% of the effort to implement all the desired features).

Definitions

First, let’s define some terms to share the same understanding.

  • Project: A temporary activity to achieve a specific goal. Projects have expenses, milestones, phases and tasks.  Labor is expended to complete tasks.
  • WBS: Work Breakdown Structure. An ordered tree of tasks and sub-tasks. WBS number: how an individual tasks is identified (e.g. “8.3.2” for a child-of-child task).

Item strategy

Procedure

Create a stock (inventory) category for project Items,

weberp-inventory-category-maintenance

and another category for labor.

weberp-labour-item-inventory-category

Create a work center

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

weberp-create-work-center

Create a customer

Before creating a customer, it is necessary to create at least one customer type,

weberp-create-customer-type

a customer price list,

weberp-create-customer-create-price-list-1

weberp-create-customer-create-price-list-2

and a sales region.

 

 

Create project and labor items

Create a Manufactured item to represent a project (it must be of type Manufactured so that a manufacturing work order can be created),

weberp-create-project-item-manufactured

and a Labour item of type Service/Labour to represent the project labor.

weberp-create-labour-item

Note that the new items will appear in an item search.

weberp-project-labour-items

Create a project BOM

Create a manufacturing BOM for the project item so that a manufacturing work order may be created, although no child items will be included on the BOM.

weberp-create-project-item-bom

Create a work order

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Issue labor to the work order

Having created a work order, you then issue materials and labor to it and receive finished goods from it. When all the materials and labor have been issued and the finished goods received from it the work order is closed and the stock of the (unsold) finished items are revalued as necessary.

Report on the project

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Close the work order

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Summary

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Contract strategy

Setup

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Create a project contract

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Create a labor item

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Create the project contract work order

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Issue labor to the project work order

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Report on the project

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Close the project

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Summary

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Conclusion

Pros and Cons of Item vs Contract strategies.

Potential Improvements.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Patch to FreeBSD Accepted!

It was an emotional moment last week when I had a patch (code change) accepted by the FreeBSD operating system. It was a relatively simple change to the dns/noip port’s post-install message to clarify the port’s configuration and use (a port is the scaffolding code that integrates a third-party application into FreeBSD, and provided as part of FreeBSD).

FreeBSD is a free Unix-like operating system, most commonly found on servers in backrooms and data centers. It is similar to Linux, except that FreeBSD is a direct open source derivative of the original AT&T Research UNIX® (Linux is a re-implementation or clone). FreeBSD is more enterprise friendly than either Microsoft Windows or Linux, because of its permissive license allowing use and rework without cost or legal restrictions (Linux imposes the restrictive copy-left GNU Public License, or GPL, limiting a business’s ability to profit from its own innovations), and because FreeBSD has a well-defined release engineering process that is visible, accessible, and emphasizes stability and trust.

The motivation for the patch came when I was re-building several systems in which the dns/noip port was used – the client for No-IP’s DDNS service. Each time I searched which files had been installed by noip to find the README file with configuration details. The problem would have been avoided entirely if the missing information had only been included in noip‘s post-install message.

I informally discussed my proposed patch with Stanislaw Halik, the dns/noip port maintainer on record, who indicated his approval. I then submitted an official PR (problem report) to the FreeBSD project, and included a patch file giving the specific changes I was proposing.

The PR was reviewed by the FreeBSD maintenance team, Stanislaw gave his official approval, and my provided patch file had been merged into the FreeBSD codebase in less than 24 hours – visible, traceable and trustable!

2016-09-16-noip-pr-212637-dalescottshaw-ca

How cool was that! Although I submitted the patch to scratch my own itch, it was accepted based on its benefit to others.

Dale
Transparency with Trust

P.S. Stanislaw also introduced me to POLA, or the Principle of Least Astonishment. POLA applies to user interface and software design, and can be taken to mean that software should behave in a way that users will anticipate. Since the dns/noip port can now be installed as a binary package (not only compiling from source as has been traditional), users installing the binary package will expect instructions to be meaningful to their situation.