~abentley/bzrtools/bzrtools.dev

  • Committer: ghigo
  • Date: 2006-03-13 20:19:41 UTC
  • Revision ID: ghigo@venice-20060313201941-1322dc5ba24517d6
Use the TreeTransform class, on the basis of the suggest of
Aaron Bentley 

---------------------------------------

Goffredo Baroncelli wrote:
| On Monday 13 March 2006 01:36, Aaron Bentley wrote:
|
|>Hi Goffredo,
|
|
| Hi Aaron,
|
|
|>I'm still waiting for your thoughts on this.  As I said, I'm willing to
|>merge it, given that it's optional.  On the other hand, there are
|>situations where it will lead to data loss, so using TreeTransform may
|>be a better approach.
|
|
| I updated the patch in order to solve some concerns. But you are right, I
| have to use the TreeTransform class. My big problem is the lack of
| documentation on how use the class: could you answer to some my question ?

Sure.  Any failings in the documentation are my fault.

| The TreeTransform class is instantiated on the working tree: but how we
| inform the class that a file is:
| - changed ( updated )

Get the trans_id with trans_id_tree_file_id
Delete the current contents with delete_contents
Add new contents with create_file (or symlink, directory)

| - created

Call new_file

| - deleted

Get the trans_id with trans_id_tree_file_id
Delete the current contents with delete_versioned

| - renamed/moved ( is it the same ? )

Get the trans_id with trans_id_tree_file_id
Call adjust_path

| Then how we can manage the conflict ?

If you create a filesystem conflict, the transform won't apply.  If you
call resolve_conflicts, it will fix filesystem conflicts, so the
transform will apply.

Text conflicts are up to you to manage.

| Reading the code, what I understood is that:
| - for every file touched, It must assign a trans_id using the function
create_path( )

create_path is only for new files.  For existing files, you should get
them from trans_id_tree_file_id, trans_id_tree_path, or trans_id_file_id.

| - the creation of a file/directory/symlink is perfomed via the
create_{directory,symlink,file)
| function

You can, but there are also the new_file, new_directory, new_symlink
convenience methods.

| - the deletion of a file ( directory, symlink ? ) is scheduled by the
| unversion_file/delete_contents depending if a file is versioned.

For a versioned file, you'd have to do both.  Or, you can use
delete_versioned_file.

| - the renaming of a directory/file/symlink is perfomed by the
adjust_path function

Right.

| - I dont understood how we manage the content change

Content changes are content deletion and content creation.

Aaron
Filename Latest Rev Last Changed Committer Comment Size
..
annotate.py 313 18 years ago Aaron Bentley Updated to match API changes 4.5 KB Diff Download File
baz2bzr 152.1.2 19 years ago Aaron Bentley Updated docs, obsoleted old executibles 3.7 KB Diff Download File
bzr-pull 74 19 years ago Aaron Bentley renamed scriptlib.py to bzrtools.py 1.2 KB Diff Download File
bzr-push 152.1.2 19 years ago Aaron Bentley Updated docs, obsoleted old executibles 962 bytes Diff Download File
shelve 152.1.2 19 years ago Aaron Bentley Updated docs, obsoleted old executibles 106 bytes Diff Download File
unshelve 152.1.2 19 years ago Aaron Bentley Updated docs, obsoleted old executibles 106 bytes Diff Download File