damn_server.new

Add new commit to the database.

Commits are the building blocks of the damn_server. The most of the mappers (users) will only add commits. (Some of them will also add areas.)

All commits are in the current_commits table of the PostGIS database. Each commit is identified by the aid – the area identifier, sid – the square identifier, and the cid – the commit identifier.

Commit without sid is possible – when the area is changed, current values of the area are stored in the commit message of new commit without sid. Therefore, commits without sid are considered to contain the history of the area.

There are more types of the commit received from the users. By the commit type, users clarify the request. See CreateCommitType.

Types of a commit stored in the database are:

  • locked – The square is locked for mapping/review by some mapper.

  • to map – The square is ready to be mapped.

  • to review – The square is ready to be reviewed.

  • done – The square is done.

  • splitted – The square has been splitted, so this particular square is done, but should not be counted in the statistics. There are new squares covering the same area of this square.

  • merged – The square was merged, probably with the other ones, into some other new square. So this particular square is done, but should not be counted in the statistics. There is new square covering the same area of this square.

  • update – The area has been changed. This commit containst the last version of the area (area history.)

Functions

commit(commit, aid, author)

Process the commit, updating the database.

lock_area_square(commit, aid, author)

Lock the square specified by the sid in the commit.

map_or_review_area(commit, aid, author)

Request the database for a square to map or review.

merge_area_squares(commit, aid, author)

Merge squares locked by the author.

split_area_square(commit, aid, author)

Split the square specified by the sid in the commit.

unlock_locked_squares(author)

Unlock locked square of the author if any.

Classes

CreateCommit

Structure for storing information about new commit to the area.

CreateCommitType

New commit type.