P4同步问题 - 文件未被删除

时间:2017-07-27 11:21:57

标签: perforce perforce-client-spec

我有一组带有文件的工作区。但是我观察到当我从perforce中删除文件并执行“p4 sync”时。文件未从工作区中删除。 但是p4 sync -f会删除该文件。

1 个答案:

答案 0 :(得分:2)

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstace, LPSTR lpCommand, int nCmdLine) { HWND window; int xpos = 100; // Horizontal position of the window. int ypos = 100; // Vertical position of the window. int nwidth = 200; // Width of the window int nheight = 200; // Height of the window HWND hwndParent = window; // Handle to the parent window MSG message; WNDCLASSEX wndClass; wndClass.cbSize = sizeof(WNDCLASSEX); wndClass.cbClsExtra = 0; wndClass.cbWndExtra = 0; wndClass.style = 0; wndClass.hInstance = hInstance; wndClass.lpfnWndProc = wndCll; wndClass.lpszClassName = classNoOne; wndClass.lpszMenuName = MAKEINTRESOURCE(IDR_MYMENU); wndClass.hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_PENGUIN_ICON)); wndClass.hIconSm = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_PENGUIN_ICON), IMAGE_ICON, LR_DEFAULTSIZE, LR_DEFAULTSIZE, 0); wndClass.hCursor = LoadCursor(NULL, IDC_ARROW); wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW-1); if(!RegisterClassEx(&wndClass)){ printf("No wndclass"); } window = CreateWindowEx(WS_EX_CLIENTEDGE, classNoOne, "Start Window", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 1000, 500, NULL, NULL, hInstance, NULL); //create the window HWND hWndComboBox = CreateWindow(WC_COMBOBOX, "name of the combobox", CBS_DROPDOWN | CBS_HASSTRINGS | WS_CHILD | WS_OVERLAPPED | WS_VISIBLE , xpos, ypos, nwidth, nheight, hwndParent, NULL, hInstance, NULL); TCHAR Planets[9][10] = { TEXT("MERCURY"), TEXT("VENUS"), TEXT("Terra"), TEXT("MARS"), TEXT("JUPITER"), TEXT("SATURN"), TEXT("URANUS"), TEXT("NEPTUNE"), TEXT("PLUTO") }; //these are the list elements TCHAR A[16]; int k = 0; memset(&A, 0, sizeof(A)); //allocate memory for(k = 0; k<=8; k+=1){ strcpy(A, (TCHAR *)Planets[k]); SendMessage(hWndComboBox,(UINT) CB_ADDSTRING,(WPARAM) 0,(LPARAM) A); } SendMessage(hWndComboBox, CB_SETCURSEL, (WPARAM)2, (LPARAM)0); ShowWindow(hWndComboBox, nCmdLine); //ShowWindow(window, nCmdLine); if(window == NULL){ printf("window is NULL"); } while(GetMessage(&message, NULL, 0, 0) > 0){ if(!IsDialogMessage(dialogSmall, &message)){ TranslateMessage(&message); DispatchMessage(&message); } } return message.wParam; } 只会在以下情况下从工作区中删除文件:

  1. 删除软件仓库文件的头版本(检查p4 sync
  2. 您当前已同步到该文件的其他(未删除)版本(请检查p4 files FILE
  3. 您目前没有打开文件(请检查p4 have FILE
  4. p4 opened FILE标志影响的这些条件中只有一个是#2,所以我怀疑你的工作区中有这个文件但是没有记录,因为已经从服务器同步了它(例如,文件放在Perforce之外,或者有-f,或类似的东西。)