Jump to content


reuse deleted branches


  • Please log in to reply
1 reply to this topic

#1 Erik

Erik

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 21 November 2018 - 07:56 AM

Hello,

We have a issue with deleted branches and is wondering if there is a way to handle this.

Say we have these files in the depot:

//depot/project1/main/file1.txt
//depot/project1/main/file2.txt
//depot/project1/main/file3.txt
//depot/project1/main/file4.txt

Say someone moved //depot/project1/main to //depot/project1/rls1

All files under //depot/project1/main now have the deleted flag.

We now want to start using //depot/project1/main again

We create these files localy in the workspace
depot/project1/main/file1.txt
depot/project1/main/file2.txt
depot/project1/main/file3.txt
depot/project1/main/file4.txt

We have a risk here, if these files are readonly on disk and the user syncs the depot these local files will be deleted (since they are deleted in the depot)

We do not want to obliterate the files since we need the history.
Is there a method/workflow to prevent this?

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 665 posts

Posted 21 November 2018 - 08:59 AM

View PostErik, on 21 November 2018 - 07:56 AM, said:

Say someone moved //depot/project1/main to //depot/project1/rls1

All files under //depot/project1/main now have the deleted flag.

We now want to start using //depot/project1/main again

First: if at all possible, do not move/rename entire branches.
Second: if you need to move/rename an entire branch, don't reuse the old name for something else.

It is *possible* to do these things, but there is no possible way that it's ever worth the hassle.  Don't do it.  Whatever you're tempted to accomplish by renaming and re-creating the branch can probably be accomplished in some much easier (and more idiomatic) way.

Quote

We have a risk here, if these files are readonly on disk and the user syncs the depot these local files will be deleted (since they are deleted in the depot)

This will only happen if on top of doing the two things I recommended against earlier, the user is doing something unusual with the deleted files, namely:

a) forcibly deleting synced (read-only) files from the workspace
b) force-syncing files that are already synced to the deleted revision




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users